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

Prevent a weird search error when displaying some facet #1097

Merged
merged 1 commit into from Aug 25, 2017
Merged

Prevent a weird search error when displaying some facet #1097

merged 1 commit into from Aug 25, 2017

Conversation

noirbizarre
Copy link
Contributor

This PR fix a weird error only happening on some config/servers when displaying search result.
I wasn't able to reproduce the issue on my own computer but I was able to identify and fix the issue on a server where it's happening.

The Bad Request error page is displayed because of this https://github.com/opendatateam/udata/blob/master/udata/frontend/error_handlers.py#L9-L11
This make sense because most of the framework (WTForm, Flask-Principal, Flask-RESTPlus...) permit to use ValueError as a validation error (and that's what is done everywhere in udata). The problem is that UnicodeError and child (UnicodeDecodeError, UnicodeEncodeError...) extends ValueError.

To fix this issue (in another PR), there is 2 possibilities:

  • use more specific exceptions that ValueError to handle this (prefered)
  • make a special case for UnicodeError and child (hackish)

@noirbizarre noirbizarre added this to the 1.1.2 milestone Aug 25, 2017
@noirbizarre noirbizarre requested a review from a team August 25, 2017 09:21
@noirbizarre noirbizarre merged commit 1ee618a into opendatateam:master Aug 25, 2017
@noirbizarre noirbizarre deleted the weird-search-error branch August 25, 2017 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant