@odla-ai/cli 0.36.0 → 0.36.1

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
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "./chunk-DBZQIMES.js";
4
+ } from "./chunk-4QJ5NS64.js";
5
5
  import {
6
6
  exitCodeFor
7
7
  } from "./chunk-UKLSRQ5J.js";
@@ -9,4 +9,4 @@ export {
9
9
  exitCodeFor,
10
10
  runCli
11
11
  };
12
- //# sourceMappingURL=cli-BN6WLH5O.js.map
12
+ //# sourceMappingURL=cli-BFGY7F6X.js.map
package/dist/index.cjs CHANGED
@@ -287,9 +287,10 @@ async function mintDeviceSession(platformUrl, credential2, doFetch) {
287
287
  });
288
288
  const body = await response2.json().catch(() => ({}));
289
289
  if (!response2.ok || typeof body.token !== "string") {
290
- const detail = body.error?.message ?? `registry returned ${response2.status}`;
290
+ const revocable = response2.status === 401 || response2.status === 403 || response2.status === 404;
291
+ const detail = body.error?.message ?? (response2.ok ? `registry returned ${response2.status} with no session token` : `registry returned ${response2.status}`);
291
292
  throw new Error(
292
- `device session failed: ${detail} (${response2.status}) \u2014 if this machine's enrollment was revoked or has expired, enroll it again in Studio`
293
+ `device session failed: ${detail} (${response2.status})` + (revocable ? " \u2014 if this machine's enrollment was revoked or has expired, enroll it again in Studio" : "")
293
294
  );
294
295
  }
295
296
  return { token: body.token, expiresAt: body.expiresAt ?? Date.now() };