Feature #2008
closed
API: better error messages
Added by Moritz Großfurtner almost 1 year ago.
Updated 12 months ago.
Description
Currently when an Image without a license is requested from the API it results in an internal Server Error. A different way of handling such cases would be preferred.
- Subject changed from Better Error Message on Requesting an Image without license to API: better message when requesting an image without license
- Status changed from New to Assigned
- Assignee set to Bernhard Koschiček-Krombholz
- Target version set to 7.15.0
Thank you for reporting, I assigned it to Bernhard but we may should discuss how to deal with files without a license together before.
Files without a specified license shouldn't be made public available. But I agree that we could handle it more elegantly than showing an internal server error.
- Subject changed from API: better message when requesting an image without license to API: better response when requesting a file without a license
There is Error Handling provided by the API in a JSON format. The problem is, that either flask (again) overwrites these error messages or some refactoring broke it. I will try to correct this. Thank you for reporting!
And what than will be the response if fixed?
Currently:
"message": "You don't have access to the API. Please ask the owner for access.",
"title": "Access Denied Error",
"timestamp": datetime.datetime.now(),
"status": 403
Will change that too, if it works. I'm happy to discuss error messages with you both in person.
Looked into the problem and sadly found no solution to work it out with the flask_restful package error handling. I'm not alone with these problems.
I will now try to use the flask/werkzeug error handling. Sorry for the inconvenience.
- Subject changed from API: better response when requesting a file without a license to API: better error messages
- Status changed from Assigned to Closed
I fixed all errors. Now it should work again and will give you reasonable error messages. If you encounter an error through the /api/ path, which is not covered with a json error message, please inform me!
Thank you for reporting!
- Target version changed from 7.15.0 to 7.13.0
Also available in: Atom
PDF