-
Notifications
You must be signed in to change notification settings - Fork 1
Improve APIError default exception messages #5
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When an uncaught exception is raised because of an HTTP status error, no useful information is printed by default.
Take this example of a traceback (rich-formatted in this case):
│ /Users/pederhan/repos/mreg-tools/.venv/lib/python3.14/site-packages/mreg_api/client.py:610 in _check_response │
│ │
│ 607 │ │ │ else: │
│ 608 │ │ │ │ msg = response.text │
│ 609 │ │ │ cls = determine_http_error_class(operation_type) │
│ ❱ 610 │ │ │ raise cls(msg, response) │
│ 611 │ │
│ 612 │ def request( │
│ 613 │ │ self, │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
GetError: 500 Internal Server Error
I suppose we should try to include response text?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request