Skip to content

Print human-readable error messages with suggestions when API calls fail#44

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/print-error-messages-for-api
Draft

Print human-readable error messages with suggestions when API calls fail#44
Copilot wants to merge 2 commits intomainfrom
copilot/print-error-messages-for-api

Conversation

Copy link

Copilot AI commented Feb 28, 2026

API failures surfaced raw HTTP exceptions (e.g. HTTPError: 500 Server Error) with no context or guidance. This adds human-readable error messages and actionable suggestions for common failure modes.

Changes

  • settings.py (new): HTTP_ERROR_MAP — maps HTTP status codes to (display_text, suggestion) tuples covering 400, 401, 403, 404, 409, 422, 429, 500, 503 with targeted suggestions (e.g. quota, project, auth)
  • utils/http.py: BaseConnection.request() catches HTTPError and re-raises with a composed message — applies to all endpoints (Materials, Workflows, Jobs)

Example

Before:

HTTPError: 500 Server Error: Internal Server Error for url: .../jobs/id/submit

After:

Error 500: Internal Server Error. An error occurred on the server. Contact support if the problem persists.
# 403 example
Error 403: Forbidden. You do not have permission to access this resource. Set the correct project or check your account permissions.

# 429 example
Error 429: Too Many Requests. You have exceeded your quota. Update your quota or try again later.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: VsevolodX <79542055+VsevolodX@users.noreply.github.com>
Copilot AI changed the title [WIP] Print actual error messages instead of generic 500 Print human-readable error messages with suggestions when API calls fail Feb 28, 2026
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.

2 participants