@netmind/arena-cli 0.35.1 → 0.35.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.
package/dist/index.js CHANGED
@@ -516,7 +516,13 @@ var loginCmd = new Command2("login").description("Log in with an existing API ke
516
516
  headers: { Authorization: `Bearer ${opts.apiKey}` }
517
517
  });
518
518
  if (!res.ok) {
519
- throw new Error(`Invalid API key (status ${res.status})`);
519
+ const body = await res.json().catch(() => ({}));
520
+ throw Object.assign(new Error(`Invalid API key (status ${res.status})`), {
521
+ status: res.status,
522
+ ...typeof body.code === "string" ? { code: body.code } : {},
523
+ ...typeof body.hint === "string" ? { hint: body.hint } : {},
524
+ ...typeof body.docs === "string" ? { docs: body.docs } : {}
525
+ });
520
526
  }
521
527
  const profile = await res.json();
522
528
  saveCredentials({