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

Error message is stripped if stack exists #32

Open
perry-mitchell opened this issue Apr 29, 2016 · 6 comments
Open

Error message is stripped if stack exists #32

perry-mitchell opened this issue Apr 29, 2016 · 6 comments

Comments

@perry-mitchell
Copy link

It seems as though the error's message is stripped if a stack trace is present (ParsedError.coffee:25):

      if typeof @_stack is 'string'
        @_parseStack()
      else
        @_message = @error.message? and String(@error.message) or ''

Resulting in something like:
screen shot 2016-04-29 at 8 50 01 pm
(when no stack is present)

And this when there is a stack:
screen shot 2016-04-29 at 8 49 46 pm

@AriaMinaei
Copy link
Owner

Currently when parsing the Error, we expect the .stack to actually start with a copy of the .message and then continue with the trace lines. That's how most stacks are composed. But I'm sure situations like the one you encountered do occur where the message is not embedded in the stack.

The fix is probably trivial. When parsing the stack and extracting the message, we can compare our extracted message with the string inside .message, and if they don't match, we'd prepend .message to the extracted one.

I can do that, but first, I need a minimal reproduction of the situation, if you can provide that please.

@koistya
Copy link

koistya commented Dec 26, 2016

I have the same issue in Node.js API Starter Kit (see src/app.js).

@lopezjurip
Copy link

Same problem here

@AriaMinaei
Copy link
Owner

AriaMinaei commented Jan 12, 2017

Guys, I need a minimal reproduction of this error to be able to fix it :) A minimal reproduction would be one package.json file, one index.js file, and running $ node index.js should reproduce the error.

@jorrit
Copy link

jorrit commented Aug 7, 2017

I have this problem with GraphQLError instances. I will see if I can make some steps to reproduce.

@jorrit
Copy link

jorrit commented Aug 7, 2017

Never mind, that situation seems to have been fixed very recently: graphql/graphql-js#718.

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

No branches or pull requests

5 participants