apollo-errors
apollo-errors copied to clipboard
Message not propagating in 1.7.1
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
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.
Thanks! I'll try to submit a fix for this later tonight
Somehow this only happens if I run it in production mode, locally it works?
Please, fix this )
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.

Any update on this? I had to downgrade to 1.5.1 😞
bump
Any updates on this?
just created a simple pull request: #32
My pull request still doesn't fix all issues so it is better to just use 1.5.1
#29 should also fix this issue
i actually lost sleep because of this issue :)
A fix for this should be live in 1.8.0. Can anyone here confirm?
@thebigredgeek confirmed it works.
@thebigredgeek missing again in 1.9 plz reopen it
@theGlenn I thought we had a test case for this. confused haha
I'm also facing this issue. It only seems to happen in production for me. Locally everything works fine.
@theGlenn did you have a chance to test for this?