@prismnetwork/agent-sdk 0.6.0 → 0.6.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/prism.mjs +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismnetwork/agent-sdk",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Headless GPU leasing and renter-encrypted storage on Prism Network for wallet-holding agents.",
5
5
  "type": "module",
6
6
  "main": "prism.mjs",
package/prism.mjs CHANGED
@@ -325,7 +325,10 @@ export class PrismAgent {
325
325
  return res.body;
326
326
  }
327
327
  if (res.status !== 404 && res.status !== 429 && res.status < 500) {
328
- throw new PrismError(res.status, res.body?.error ?? "access_error", res.body);
328
+ // The control plane names the reason in `code`; without it a lease that
329
+ // will never open access reports as a generic `access_error` and the
330
+ // caller has to go and read the body to learn anything.
331
+ throw new PrismError(res.status, res.body?.error ?? res.body?.code ?? "access_error", res.body);
329
332
  }
330
333
  await sleep(intervalMs);
331
334
  }