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

[bugfix] Encode unicode error message response #5687

Merged
merged 2 commits into from
Aug 22, 2018

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Aug 21, 2018

When response error is unicode object, raise UnicodeEncodeError

@zhaoyongjie zhaoyongjie changed the title Fix unicode error message response [bugfix] Unicode error message response Aug 21, 2018
@zhaoyongjie zhaoyongjie changed the title [bugfix] Unicode error message response [bugfix] Encode unicode error message response Aug 21, 2018
@codecov-io
Copy link

codecov-io commented Aug 21, 2018

Codecov Report

Merging #5687 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5687      +/-   ##
==========================================
- Coverage   63.49%   63.49%   -0.01%     
==========================================
  Files         360      360              
  Lines       22914    22934      +20     
  Branches     2551     2555       +4     
==========================================
+ Hits        14550    14562      +12     
- Misses       8349     8357       +8     
  Partials       15       15
Impacted Files Coverage Δ
superset/views/base.py 68% <100%> (ø) ⬆️
superset/db_engine_specs.py 54.15% <0%> (-0.28%) ⬇️
superset/viz.py 81.3% <0%> (-0.05%) ⬇️
superset/assets/src/explore/visTypes.jsx 57.14% <0%> (ø) ⬆️
...hboard/components/gridComponents/new/NewHeader.jsx 100% <0%> (ø) ⬆️
...board/components/gridComponents/new/NewDivider.jsx 100% <0%> (ø) ⬆️
superset/assets/src/explore/controls.jsx 45.92% <0%> (ø) ⬆️
...hboard/components/gridComponents/new/NewColumn.jsx 100% <0%> (ø) ⬆️
.../assets/src/visualizations/parallel_coordinates.js 0% <0%> (ø) ⬆️
...ashboard/components/gridComponents/new/NewTabs.jsx 100% <0%> (ø) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fbda33...42fbaf5. Read the comment docs.

@@ -45,7 +45,7 @@ def get_error_msg():

def json_error_response(msg=None, status=500, stacktrace=None, payload=None, link=None):
if not payload:
payload = {'error': str(msg)}
payload = {'error': msg.encode('utf-8')}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is py3 compatible, go with '{}'.format(msg)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mistercrunch Thank you for reminding. updated commit

@mistercrunch mistercrunch merged commit ebe585d into apache:master Aug 22, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Fix unicode error message response

* Update
@zhaoyongjie zhaoyongjie deleted the fix_errors_response branch September 21, 2020 14:43
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants