drapcode-utility 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -163,6 +163,14 @@ const callCurlRequest = async (setting, user = {}, tenant = {}, userSetting = {}
|
|
|
163
163
|
return prepareReturnObject(errorMessage);
|
|
164
164
|
}
|
|
165
165
|
drapcode_logger_1.logger.info(`result.status: ${result?.status}`, { label: projectId });
|
|
166
|
+
if (!result?.data) {
|
|
167
|
+
// In some cases when axios throws error with status 4xx the actual error message is in response.data
|
|
168
|
+
const errResponse = result?.response;
|
|
169
|
+
const errData = errResponse?.data;
|
|
170
|
+
if (errData && Object.keys(errData).length > 0) {
|
|
171
|
+
result.data = errData;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
166
174
|
deleteLocalFiles(isMultipart, toDeleteFiles);
|
|
167
175
|
return prepareReturnObject(result.data, result.status, true, result?.headers);
|
|
168
176
|
}
|