Use correct error object

This commit is contained in:
Johannes Zellner
2021-12-15 17:22:16 +01:00
parent a3280a0e30
commit d6fbe2a1bb

View File

@@ -1683,7 +1683,7 @@ async function setLocation(app, data, auditSource) {
values
};
let [taskError, taskId] = await safe(addTask(appId, exports.ISTATE_PENDING_LOCATION_CHANGE, task, auditSource));
if (taskError && taskError.reason === BoxError.ALREADY_EXISTS) taskError = getDuplicateErrorDetails(error.message, locations, domainObjectMap, data.portBindings);
if (taskError && taskError.reason === BoxError.ALREADY_EXISTS) taskError = getDuplicateErrorDetails(taskError.message, locations, domainObjectMap, data.portBindings);
if (taskError) throw taskError;
values.fqdn = dns.fqdn(values.location, domainObjectMap[values.domain]);