Skip to content
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

Add install_requires argument in setup.py file #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ragnarokatz
Copy link

referenced issue #2

@eric-s-s
Copy link
Owner

eric-s-s commented Oct 9, 2019

excellent! a bug is found! perhaps there was a newer version of one of the libraries that now behaves differently. i will try to look into this in the next few days, or if you want to hunt it down, that would be great!

@eric-s-s
Copy link
Owner

I found the issue. All regular exceptions are now converted to InternalServerError connections within the app

https://flask.palletsprojects.com/en/1.1.x/errorhandling/#handling

this might need a re-write to deal with new situation

@eric-s-s
Copy link
Owner

and the breaking change came from here:

https://flask.palletsprojects.com/en/1.1.x/errorhandling/#unhandled-exceptions

@ragnarokatz
Copy link
Author

@eric-s-s correct. This exception's the root cause is here:

test_bind_json_error_handlers_non_HTTPException_error_as_acting_in_app (tests.test_bind_json_error_handler.TestBindJSONErrorHandler) ... [2019-10-09 18:29:21,297] ERROR in app: Exception on /error/other [GET]
Traceback (most recent call last):
  File "/home/travis/build/eric-s-s/bind_json_error_handlers/tests/test_bind_json_error_handler.py", line 20, in get_errors
    raise error_dict[error_name](description=TEST_MESSAGE)
KeyError: 'other'

then flask just took this unhandled exception and threw a generic 500 internal server error instead.

@eric-s-s
Copy link
Owner

If you're up for fixing the problem, go for it! I'd still like to send information about the unhandled exception. If not, let me know and I'll get around to it in a few days.

@ragnarokatz
Copy link
Author

@eric-s-s hey, I gave it a try.

in test case test_bind_json_error_handlers_non_HTTPException_error_as_acting_in_app,
the list of default_exceptions from werkzeug.exceptions does not include the key other.

Here are the available keys from default_exceptions:

['BadRequest', 'Unauthorized', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLarge', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'ImATeapot', 'UnprocessableEntity', 'Locked', 'FailedDependency', 'PreconditionRequired', 'TooManyRequests', 'RequestHeaderFieldsTooLarge', 'UnavailableForLegalReasons', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported']

@ragnarokatz
Copy link
Author

ragnarokatz commented Oct 17, 2019

As a result of this, the test case test_create_test_app_TypeError should fail as well. it's just the test hasn't gotten to that stage yet.

for a solution, should I just add 'other' as a key to the dictionary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants