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

Add ApolloError in error body when handling errors #6956

Merged

Conversation

hlubek
Copy link
Contributor

@hlubek hlubek commented Dec 7, 2021

Fixes #6953

I added a test to check for correct error handling when executing a mutation.

@vercel
Copy link

vercel bot commented Dec 7, 2021

@hlubek is attempting to deploy a commit to the Marmelab Team on Vercel.

A member of the Team first needs to authorize it.

@@ -221,15 +221,14 @@ export default async (options: Options): Promise<DataProvider> => {
};

const handleError = (error: ApolloError) => {
console.error({ error });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this console.error should not be here. Since handleError re-throws, it should be logged / catched at higher levels.

@WiXSL WiXSL added the RFR Ready For Review label Jan 27, 2022
@WiXSL
Copy link
Contributor

WiXSL commented Jan 27, 2022

Thanks for your contribution!
Seems ok

@fzaninotto fzaninotto merged commit 04a579a into marmelab:master Jan 28, 2022
@fzaninotto fzaninotto added this to the v3.19.8 milestone Jan 28, 2022
@fzaninotto
Copy link
Member

Thanks!

@hlubek hlubek deleted the 6953-ra-data-graphql-set-error-body branch June 27, 2022 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ra-data-graphql: Missing original error as body in handleError
3 participants