Fix assert

NETWORK_ERROR is usually an AggregateError which causes an
assert in BoxError
This commit is contained in:
Girish Ramakrishnan
2024-11-19 17:08:19 +05:30
parent e35b36643c
commit 5e3857fd3d
15 changed files with 69 additions and 68 deletions

View File

@@ -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));