Fix assert
NETWORK_ERROR is usually an AggregateError which causes an assert in BoxError
This commit is contained in:
@@ -61,7 +61,7 @@ async function getZone(domainConfig, zoneName) {
|
||||
query.TLD = zoneName.slice(query.SLD.length + 1);
|
||||
|
||||
const [error, response] = await safe(superagent.get(ENDPOINT).query(query).ok(() => true));
|
||||
if (error) throw new BoxError(BoxError.NETWORK_ERROR, error.message);
|
||||
if (error) throw new BoxError(BoxError.NETWORK_ERROR, error);
|
||||
|
||||
const parser = new xml2js.Parser();
|
||||
const [parserError, result] = await safe(util.promisify(parser.parseString)(response.text));
|
||||
|
||||
Reference in New Issue
Block a user