diff --git a/src/sdk/exceptions.test.ts b/src/sdk/exceptions.test.ts index 48a5e00..afac242 100644 --- a/src/sdk/exceptions.test.ts +++ b/src/sdk/exceptions.test.ts @@ -27,6 +27,8 @@ describe("toSdkError", () => { ["idempotency_key_reuse", IdempotencyKeyReuse], ["insufficient_credits", InsufficientCredits], ["not_found", NotFound], + ["job_not_found", NotFound], + ["asset_not_found", NotFound], ["unauthorized", Unauthorized], ["forbidden", Forbidden], ]; diff --git a/src/sdk/exceptions.ts b/src/sdk/exceptions.ts index a012ba0..9d164ab 100644 --- a/src/sdk/exceptions.ts +++ b/src/sdk/exceptions.ts @@ -94,6 +94,11 @@ const BY_CODE: Record = { idempotency_key_reuse: IdempotencyKeyReuse, insufficient_credits: InsufficientCredits, not_found: NotFound, + // public-api returns entity-specific 404 codes even though the spec documents + // the generic not_found; map them so a missing job/asset raises the typed + // NotFound. (Server/spec reconciliation of the code set is a separate follow-up.) + job_not_found: NotFound, + asset_not_found: NotFound, unauthorized: Unauthorized, forbidden: Forbidden, };