JSON error handling
This PR starts the consolidation process of error handling throughout the backend. Now, errors are raised as exceptions that propagate to route-wide or app-wide handlers attached via register_error_handler
.
Example JSON:
{
"object": "error",
"type": "invalid_request_error",
"error_code": "validation_error",
"status_code": 400,
"friendly_message": "Some message we can display to the user here",
"params": "something can go here, an array, object, etc"
}
Edited by Derrick Liu