-
-
Notifications
You must be signed in to change notification settings - Fork 400
Closed
Description
Currently, errors are raised for specific HTTP status codes (error.rb#L142). This allows us to have specially named classes like BadRequest (for 400 status code).
But it means that for any status code not in the map, no error is raised. This can cause subtle bugs when a 4xx or 5xx status code is received but it doesn't raise an error. This is especially problematic for APIs that don't return a JSON response, such as the file_contents method.
What do you think of raising an error for any 4xx and 5xx status code?
- If the status code has a special class associated with it, we can raise an error of that class (as happens now).
- But if there is no special class available, raise a
ResponseError.
Metadata
Metadata
Assignees
Labels
No labels