bamboo-agents 0.1.5-dev.41.aa82457 → 0.1.5-dev.42.12bcb59

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/dist/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5-dev.41.aa82457
1
+ 0.1.5-dev.42.12bcb59
package/dist/index.js CHANGED
@@ -3037,7 +3037,7 @@ var VERSION;
3037
3037
  var init_version = __esm({
3038
3038
  "src/version.ts"() {
3039
3039
  "use strict";
3040
- VERSION = "0.1.5-dev.41.aa82457";
3040
+ VERSION = "0.1.5-dev.42.12bcb59";
3041
3041
  }
3042
3042
  });
3043
3043
 
@@ -12123,8 +12123,14 @@ async function parseError(res) {
12123
12123
  body = await res.json();
12124
12124
  } catch {
12125
12125
  }
12126
- const message = body.message ?? body.error ?? `HTTP ${res.status} from ${res.url}`;
12127
- return new ApiError(message, res.status, body.error);
12126
+ const nested = typeof body.error === "object" ? body.error : void 0;
12127
+ const flatError = typeof body.error === "string" ? body.error : void 0;
12128
+ let message = nested?.message ?? body.message ?? flatError ?? `HTTP ${res.status} from ${res.url}`;
12129
+ const code = nested?.code ?? flatError;
12130
+ if (res.status === 401) {
12131
+ message += " \u2014 run `bamboo-agents login` to re-authenticate.";
12132
+ }
12133
+ return new ApiError(message, res.status, code);
12128
12134
  }
12129
12135
  function userAgent() {
12130
12136
  const nodeVersion = process.versions.node;