@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.
package/dist/bin.cjs CHANGED
@@ -401,9 +401,10 @@ async function mintDeviceSession(platformUrl, credential2, doFetch) {
401
401
  });
402
402
  const body = await response2.json().catch(() => ({}));
403
403
  if (!response2.ok || typeof body.token !== "string") {
404
- const detail = body.error?.message ?? `registry returned ${response2.status}`;
404
+ const revocable = response2.status === 401 || response2.status === 403 || response2.status === 404;
405
+ const detail = body.error?.message ?? (response2.ok ? `registry returned ${response2.status} with no session token` : `registry returned ${response2.status}`);
405
406
  throw new Error(
406
- `device session failed: ${detail} (${response2.status}) \u2014 if this machine's enrollment was revoked or has expired, enroll it again in Studio`
407
+ `device session failed: ${detail} (${response2.status})` + (revocable ? " \u2014 if this machine's enrollment was revoked or has expired, enroll it again in Studio" : "")
407
408
  );
408
409
  }
409
410
  return { token: body.token, expiresAt: body.expiresAt ?? Date.now() };