-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New CATMAID error handling #142
Comments
Thanks @clbarnes. What should I expect to get back? An appropriate error code with a body containing the detailed error message as json? Is there can example somewhere? AFAICS the |
The response body is exactly the same as it was before - a JSON object containing the error type, message, and traceback. All that's changing is the status code, which will now be 400, 401 or 500 as appropriate when the backend raises an exception. Presumably rcatmaid currently just ignores the status code as it's not informative, so I wouldn't expect this change to break anything; however, going forward you'll have the option of checking the status code to detect an error response, instead of having to parse the JSON and check its contents. |
Just for documentation purposes: catmaid/CATMAID@3b49a43 breaks rcatmaid compatibility; catmaid/CATMAID@1ac3845 fixes it again. Both are only in dev currently, the next release will include both. The neurocean catmaidL1 instance we run has been updated with the fix (thanks to Michael Winding for catching this). |
Just a note that right now an http error code would trigger an immediate exception without parsing the catmaid error message. Some change will be required to continue to print informative error messages. |
As of catmaid/CATMAID#1923 (not released at time of writing), the CATMAID server will return meaningful status codes on errors. The response content still contains the same JSON-serialised exception info, but the status code will no longer be 200. Generally, it will be 500, unless the server raised a ValueError (assumed to be the result of bad inputs, so it's 400), or the user had insufficient privileges (401).
This is a warning that you may need to update your fetch layer (although hopefully it's a welcome change!). Thanks @tomka for making the change.
Tracking issue here: catmaid/CATMAID#1921
The text was updated successfully, but these errors were encountered: