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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.23.13-dev-target-commands",
4
+ "version": "1.23.14-dev-target-commands",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "homepage": "https://buddy.works/docs/cli",
@@ -260,7 +260,21 @@ class ApiClient {
260
260
  throw new Error(texts_1.ERR_REST_API_NOT_RESPONDING);
261
261
  }
262
262
  else {
263
- await responseBody.dump();
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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.23.13-dev-target-commands",
4
+ "version": "1.23.14-dev-target-commands",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "homepage": "https://buddy.works/docs/cli",