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

return upstream error code to the client #33

Open
praveenweb opened this issue Jul 14, 2020 · 0 comments
Open

return upstream error code to the client #33

praveenweb opened this issue Jul 14, 2020 · 0 comments

Comments

@praveenweb
Copy link
Member

The codegen for error handling looks like this:

if (errors) {
    return res.status(400).json(errors[0])
}

This doesn't send the code received in the errors[0].extensions object and only sends the message. Ideally the codegen should send back the error code as it is to the client.

The updated error handling would look like this:

if (errors) {
    return res.status(400).json( { code: errors[0].extensions.code, message: errors[0].message } );
}
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

1 participant