We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Any unexpected error is translated to ServerError with default error code:
ServerError
flask-jsonrpc/src/flask_jsonrpc/site.py
Line 146 in a72a0c4
It would be useful to convert, for example, JWTError (https://github.com/mattupstate/flask-jwt/blob/c27084114e258863b82753fc574a362cd6c62fcd/flask_jwt/__init__.py#L160) to ServerError with specific error code for easier and more deterministic (avoiding string comparison) error handling in frontend.
Changing
jsonrpc_error = ServerError(data={'message': str(e)})
into something similar to:
jsonrpc_error = self.make_unexpected_error(e)
could maybe work, if we then could specify custom handler for unexpected errors.
The text was updated successfully, but these errors were encountered:
Maybe here, instead of creating an error handling by scratch, uses the Flask Error Handling: https://flask.palletsprojects.com/en/2.2.x/errorhandling/#error-handlers
I will check out how to use that, ;).
Sorry, something went wrong.
No branches or pull requests
Any unexpected error is translated to
ServerError
with default error code:flask-jsonrpc/src/flask_jsonrpc/site.py
Line 146 in a72a0c4
It would be useful to convert, for example, JWTError (https://github.com/mattupstate/flask-jwt/blob/c27084114e258863b82753fc574a362cd6c62fcd/flask_jwt/__init__.py#L160) to ServerError with specific error code for easier and more deterministic (avoiding string comparison) error handling in frontend.
Changing
into something similar to:
could maybe work, if we then could specify custom handler for unexpected errors.
The text was updated successfully, but these errors were encountered: