Scrubbing errors? #510
Unanswered
Faithfinder
asked this question in
Q&A
Replies: 2 comments
-
Genius ideas are simplest. For now I'm just doing an |
Beta Was this translation helpful? Give feedback.
0 replies
-
For version 7 you can catch the import {ClientError} from 'graphql-request';
try {
// Code making the request
} catch (error) {
let message = 'Unknown Error';
if (error instanceof ClientError) {
// Capture first error message from GraphQL response
message = error.response.errors?[0]?.message ?? 'Unknown Error';
// Alternatively join all error messages from GraphQL into a single string
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Right now the whole request gets appended to the error message, e.g. the message looks like this:
This then goes to Sentry, leaking user password. I would like to scrub it, but the fact that it's just a string makes it a pain in the ass. Any advice?
Beta Was this translation helpful? Give feedback.
All reactions