From f421fd771ff0e0550381d012414a6c35c8fd2afe Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 9 Dec 2025 14:36:36 +0100 Subject: [PATCH] Prefix domain (un)register calls with the domain which failed The info would also be in the extra error info, however we catch the error in apptask and here we don't know if this is a domain error or something else. --- src/dns.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dns.js b/src/dns.js index dff824e34..a0dc101c2 100644 --- a/src/dns.js +++ b/src/dns.js @@ -236,7 +236,7 @@ async function registerLocation(location, options, recordType, recordValue) { if (getError) { const retryable = getError.reason !== BoxError.ACCESS_DENIED && getError.reason !== BoxError.NOT_FOUND; // NOT_FOUND is when zone is not found debug(`registerLocation: Get error. retryable: ${retryable}. ${getError.message}`); - throw new BoxError(getError.reason, getError.message, { domain: location, retryable }); + throw new BoxError(getError.reason, `${location.domain}: ${getError.message}`, { domain: location, retryable }); } if (values.length === 1 && values[0] === recordValue) return; // up-to-date @@ -248,7 +248,7 @@ async function registerLocation(location, options, recordType, recordValue) { if (upsertError) { const retryable = upsertError.reason === BoxError.BUSY || upsertError.reason === BoxError.EXTERNAL_ERROR; debug(`registerLocation: Upsert error. retryable: ${retryable}. ${upsertError.message}`); - throw new BoxError(BoxError.EXTERNAL_ERROR, upsertError.message, { domain: location, retryable }); + throw new BoxError(BoxError.EXTERNAL_ERROR, `${location.domain}: ${getError.message}`, { domain: location, retryable }); } } @@ -302,7 +302,7 @@ async function unregisterLocation(location, recordType, recordValue) { const retryable = error.reason === BoxError.BUSY || error.reason === BoxError.EXTERNAL_ERROR; debug(`unregisterLocation: Error unregistering location ${recordType}. retryable: ${retryable}. ${error.message}`); - throw new BoxError(BoxError.EXTERNAL_ERROR, error, { domain: location, retryable }); + throw new BoxError(BoxError.EXTERNAL_ERROR, `${location.domain}: ${error.message}`, { domain: location, retryable }); } async function unregisterLocations(locations, progressCallback) {