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

Message not propagating in 1.7.1 #28

Open
prperrino opened this issue Feb 26, 2018 · 18 comments
Open

Message not propagating in 1.7.1 #28

prperrino opened this issue Feb 26, 2018 · 18 comments

Comments

@prperrino
Copy link

prperrino commented Feb 26, 2018

Changes between versions 1.5.1 and 1.7.1 appear to have broken the message field propagation when using createError:

const myError = createError('BadError', { message: "This is bad"});
var theError = new myError();
console.log(theError.message)

output of message field is undefined....

Works great in 1.5.1, broken in 1.7.1

@azterix
Copy link

azterix commented Feb 26, 2018

I am seeing the same thing. I don't know enough about the history and/or reasoning to use arguments[2] in the ApolloError constructor (instead of using the config variable) to put in a PR for it, but there are only 2 args in the arguments array when I through and the relevant data is in config / arguments[1].

I haven't tried v 1.5.1 myself, but by tweaking that argument reference it works as expected for me.

@thebigredgeek
Copy link
Owner

Thanks! I'll try to submit a fix for this later tonight

@Ponjimon
Copy link

Ponjimon commented Mar 1, 2018

Somehow this only happens if I run it in production mode, locally it works?

@groundmuffin
Copy link

Please, fix this )

@Connorelsea
Copy link

I am attempting to throw an error inside of a resolver by doing throwing an error created using apollo-errors

const UserDoesntExistError = createError("UserDoesntExist", {
  message: "A user with this email address does not exist",
})
...
if (!user) throw new UserDoesntExistError()

On the frontend when this error occurs, the message is not displayed.

image

@lobodart
Copy link

lobodart commented Mar 6, 2018

Any update on this? I had to downgrade to 1.5.1 😞

@joshmanders
Copy link

bump

@dakshshah96
Copy link

Any updates on this?

@luisgrases
Copy link
Contributor

just created a simple pull request: #32

@luisgrases
Copy link
Contributor

My pull request still doesn't fix all issues so it is better to just use 1.5.1

@ecwyne
Copy link

ecwyne commented Mar 18, 2018

#29 should also fix this issue

@groundmuffin
Copy link

i actually lost sleep because of this issue :)

@thebigredgeek
Copy link
Owner

A fix for this should be live in 1.8.0. Can anyone here confirm?

@joshmanders
Copy link

@thebigredgeek confirmed it works.

@ash0080
Copy link

ash0080 commented Jul 24, 2018

@thebigredgeek missing again in 1.9 plz reopen it

@theGlenn theGlenn reopened this Jul 25, 2018
@thebigredgeek
Copy link
Owner

@theGlenn I thought we had a test case for this. confused haha

@pcorey
Copy link

pcorey commented Aug 17, 2018

I'm also facing this issue. It only seems to happen in production for me. Locally everything works fine.

@thebigredgeek
Copy link
Owner

@theGlenn did you have a chance to test for this?

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 a pull request may close this issue.