Skip to content

fix(graphene)handle unicode exception message #92

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

Conversation

romulorosa
Copy link
Contributor

@romulorosa romulorosa commented Nov 3, 2016

This PR handle exceptions raised using unicode

@@ -9,7 +9,10 @@ class GraphQLLocatedError(GraphQLError):

def __init__(self, nodes, original_error=None):
if original_error:
message = str(original_error)
try:
message = str(original_error)
Copy link
Member

Choose a reason for hiding this comment

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

What if instead of message = str(original_error) we do message= original_error.message always?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because in Python 3.X Exception doesn't have .message attribute

@syrusakbary syrusakbary merged commit 5474674 into graphql-python:master Nov 15, 2016
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.

2 participants