Skip to content

fix: include response body and operation context in HTTP error messages#3

Open
gabdorf wants to merge 1 commit intowaspeer:mainfrom
gabdorf:fix/improve-http-error-messages
Open

fix: include response body and operation context in HTTP error messages#3
gabdorf wants to merge 1 commit intowaspeer:mainfrom
gabdorf:fix/improve-http-error-messages

Conversation

@gabdorf
Copy link

@gabdorf gabdorf commented Jan 16, 2026

Summary

  • Enhanced HTTP error messages to include the response body from the API for better debugging
  • Added operation context to error messages (e.g., "Failed to create task:")
  • Helps users understand what went wrong when API calls fail

Changes

Modified wrapToolError() in src/tools/errors.ts to:

  • Include the operation name in the error message
  • Append the API response body (JSON) when available

Before

HTTP error (client_error): Request failed with status 400

After

Failed to create task: HTTP error (client_error): Request failed with status 400 - Response: {"error": "Invalid field value"}

Closes #1

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.

HTTP error messages lack response body details

1 participant