Skip to content

fix(image,speech): pass through actual API error messages on FAILED status#53

Merged
TimPietruskyRunPod merged 1 commit intomainfrom
fix/pass-through-api-error-messages
Jan 21, 2026
Merged

fix(image,speech): pass through actual API error messages on FAILED status#53
TimPietruskyRunPod merged 1 commit intomainfrom
fix/pass-through-api-error-messages

Conversation

@TimPietruskyRunPod
Copy link
Member

Summary

  • Fixes image model to pass through actual API error message when status is FAILED on initial /runsync response
  • Fixes speech model with the same issue (discovered during audit)
  • Adds tests using real API error response formats

Problem

When the Runpod API returns a FAILED status, the SDK was throwing generic errors:

  • Image: "Unexpected response status: FAILED"
  • Speech: "Runpod speech response did not include an audio_url."

Instead of the actual error message from the API, e.g.:

  • "Total pixels (262144) must be between 589824 and 2073600."
  • "Failed to download voice prompt from provided URL."

Changes

  • src/runpod-image-model.ts: Added error field to response schema and FAILED status handler
  • src/runpod-speech-model.ts: Added FAILED status handler
  • Added tests with real API error response formats

Test plan

  • pnpm type-check passes
  • pnpm lint passes (0 errors)
  • pnpm test passes (58 tests, node + edge)
  • Verified with real API calls that error messages are returned correctly

Closes #52

…tatus

When the Runpod API returns a FAILED status, the SDK now surfaces the
actual error message instead of throwing generic errors.

Image model:
- Added `error` field to response schema
- Added explicit FAILED status handler for initial /runsync response
- Polling already handled this correctly

Speech model:
- Added FAILED status handler (same issue existed here)

Closes #52
@justinwlin justinwlin self-requested a review January 20, 2026 21:34
@TimPietruskyRunPod TimPietruskyRunPod merged commit 0c53bde into main Jan 21, 2026
3 checks passed
@TimPietruskyRunPod TimPietruskyRunPod deleted the fix/pass-through-api-error-messages branch January 21, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass through actual error message when status is FAILED

2 participants