[PR #11] [MERGED] fix: map entity-specific 404 codes (job/asset_not_found) to NotFound #20

Closed
opened 2026-10-26 22:40:44 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/11
Author: @wei-hai
Created: 7/22/2026
Status: ✅ Merged
Merged: 7/22/2026
Merged by: @wei-hai

Base: main ← Head: fix/map-entity-notfound-codes


📝 Commits (1)

  • d0fa09d fix: map entity-specific 404 codes (job/asset_not_found) to NotFound

📊 Changes

2 files changed (+23 additions, -0 deletions)

View changed files

📝 src/comfy_sdk/exceptions.py (+6 -0)
➕ tests/test_error_mapping.py (+17 -0)

📄 Description

Testing against prod, client.jobs.get("<missing-uuid>") raised a generic ApiError ("Job not found") instead of the typed NotFound the SDK contract promises.

public-api returns entity-specific 404 error codes (job_not_found, asset_not_found) even though the spec documents the generic not_found, so those codes fell through _BY_CODE to the base error.

Fix: map job_not_found and asset_not_found → NotFound. A parametrized test covers all three 404 codes. (Reconciling the spec/server code set — generic vs. entity-specific — is a separate follow-up.)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-python-sdk/pull/11 **Author:** [@wei-hai](https://github.com/wei-hai) **Created:** 7/22/2026 **Status:** ✅ Merged **Merged:** 7/22/2026 **Merged by:** [@wei-hai](https://github.com/wei-hai) **Base:** `main` ← **Head:** `fix/map-entity-notfound-codes` --- ### 📝 Commits (1) - [`d0fa09d`](https://github.com/Comfy-Org/comfy-python-sdk/commit/d0fa09df4a151f53b0368a06f8232050dd041c34) fix: map entity-specific 404 codes (job/asset_not_found) to NotFound ### 📊 Changes **2 files changed** (+23 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/comfy_sdk/exceptions.py` (+6 -0) ➕ `tests/test_error_mapping.py` (+17 -0) </details> ### 📄 Description Testing against prod, `client.jobs.get("<missing-uuid>")` raised a **generic `ApiError`** ("Job not found") instead of the typed **`NotFound`** the SDK contract promises. public-api returns entity-specific 404 error codes (`job_not_found`, `asset_not_found`) even though the spec documents the generic `not_found`, so those codes fell through `_BY_CODE` to the base error. **Fix:** map `job_not_found` and `asset_not_found` → `NotFound`. A parametrized test covers all three 404 codes. (Reconciling the spec/server code set — generic vs. entity-specific — is a separate follow-up.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:40:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-python-sdk#20
No description provided.