-
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
Better exception handling #312
Milestone
Comments
16 tasks
@zelima one comment - i don't mind using generic exception object |
zelima
added a commit
that referenced
this issue
Apr 28, 2017
… simple error throwing. tests updated - refs #312
zelima
added a commit
that referenced
this issue
Apr 28, 2017
zelima
added a commit
that referenced
this issue
May 3, 2017
…classand registered at top level with hanlders for 400, 401, 404 adn 500 - refs #312
zelima
added a commit
that referenced
this issue
May 3, 2017
- controllers refactored to handle internal server errors without try/catch - new tests, as previous ones were not full covering all cases - tests refactored to assert new error messages
zelima
added a commit
that referenced
this issue
May 3, 2017
FIXED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have very generic exception and in some places we are even swallowing them.
Acceptance criteria
Tasks
Analysis
swallowing exceptions
get_s3_object()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L69delete_data_package()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L177change_acl
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L205copy_to_new_version()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L228create_or_update_tag()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L294change_status()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L346delete_data_package()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L368get_package()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/models.py#L385datapackage_show()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/site/controllers.py#L58Generic exceptions
get_user_from_cookie()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/__init__.py#L120.tag_data_package()
https://github.com/frictionlessdata/dpr-api/blob/master/app/package/controllers.py#L86delete_data_package()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/controllers.py#L140undelete_data_package()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/controllers.py#L194purge_data_package()
- https://github.com/frictionlessdata/dpr-api/blob/master/app/package/controllers.py#L247Other comments
More specific exception handling, general Exception is always bad, should be specific type of exception.
On the above two points, and an earlier one - If we handle Exception and return False, especially on operations such as reading, writing and deleting user data, we have a real problem waiting to appear in unexpected ways.
This seems like a bad place to silently swallow an exception:
The text was updated successfully, but these errors were encountered: