Feature #2008
closedAPI: better error messages
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.
Updated by Alexander Watzinger over 1 year ago
- 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.
Updated by Alexander Watzinger over 1 year ago
- Subject changed from API: better message when requesting an image without license to API: better response when requesting a file without a license
Updated by Bernhard Koschiček-Krombholz over 1 year ago
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!
Updated by Alexander Watzinger over 1 year ago
And what than will be the response if fixed?
Updated by Bernhard Koschiček-Krombholz over 1 year ago
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.
Updated by Bernhard Koschiček-Krombholz over 1 year ago
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.
Updated by Bernhard Koschiček-Krombholz over 1 year ago
- 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!
Updated by Alexander Watzinger over 1 year ago
- Target version changed from 7.15.0 to 7.13.0