Adds message to stack trace of GraphQLError.#718
Merged
leebyron merged 4 commits intographql:masterfrom May 18, 2017
Merged
Conversation
Contributor
|
Thanks for this. I added a commit that fixes a small (pre-existing) typo in the comment. This is subtle and I wouldn't be surprised if the behavior differs according to the JS engine at play, but at the same time it does seem relatively low risk. I'll let this bake for a while to give others chance to comment. |
Contributor
|
Closing this one, as it has been superseded by #722. |
Contributor
Author
|
@wincent Thanks :) I was considering leaving it open since I believe Github should auto-close this if the commits landed in the other PR? But it is less confusing to close this proactively. |
Contributor
|
Seems like the issue was creating the stack property before creating the message property, so I updated this to move stack property creation to happen last instead of first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this sample code run in Node:
You get an error that looks like it should have a message, but because of how we create GraphQLErrors, it does not:
With this PR, we add the message before generating the stack trace. The result becomes: