bdy 1.23.13-dev-target-commands → 1.23.14-dev-target-commands
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.
- package/distTs/package.json +1 -1
- package/distTs/src/api/client.js +15 -1
- package/package.json +1 -1
package/distTs/package.json
CHANGED
package/distTs/src/api/client.js
CHANGED
|
@@ -260,7 +260,21 @@ class ApiClient {
|
|
|
260
260
|
throw new Error(texts_1.ERR_REST_API_NOT_RESPONDING);
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
|
-
|
|
263
|
+
// Any other error status (409, 422, 5xx...): surface the API's own
|
|
264
|
+
// message when the body carries one (e.g. "Concurrency limit reached")
|
|
265
|
+
// instead of reducing it to a bare HTTP code.
|
|
266
|
+
let json;
|
|
267
|
+
try {
|
|
268
|
+
json = await responseBody.json();
|
|
269
|
+
}
|
|
270
|
+
catch {
|
|
271
|
+
throw new Error((0, texts_1.ERR_REST_API_HTTP_ERROR)(status));
|
|
272
|
+
}
|
|
273
|
+
logger_1.default.debug('API CLIENT PARSED RESPONSE:');
|
|
274
|
+
logger_1.default.debug(json);
|
|
275
|
+
if (json.errors && json.errors[0] && json.errors[0].message) {
|
|
276
|
+
throw new Error((0, texts_1.ERR_API_MESSAGE_REPLACER)(json.errors[0].message, path, this.baseUrl, rateLimitReset));
|
|
277
|
+
}
|
|
264
278
|
throw new Error((0, texts_1.ERR_REST_API_HTTP_ERROR)(status));
|
|
265
279
|
}
|
|
266
280
|
}
|