Repository navigation
onUnhandledRequest: Suppress exceptions when parsing potential GraphQL requests - #740
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 06aaf7a:
|
kettanaito
left a comment
There was a problem hiding this comment.
Thank you for working on these improvements, @thomasmery!
They look great. I've left a few comments, could you please let me know what you think about them?
Looking forward to seeing this fix merged.
|
@kettanaito will get to it as soon as I am able :) thanks for the guidance! |
|
Hey, @thomasmery. I've updated your feature branch against the latest state of the repo and polished the implementation a little, mainly adding missing tests. I hope you don't mind. Looks good to get it merged, waiting for the CI to pass. |
| return parseGraphQLRequest(request) | ||
| return tryCatch( | ||
| () => parseGraphQLRequest(request), | ||
| (error) => console.error(error.message), |
There was a problem hiding this comment.
Handling parsing exceptions as console errors to preserve the previous behavior. At the moment, when parsing a request in a graphql handler fails, it doesn't produce a 500 response, but a console error including the parsing error.
|
@kettanaito ah so sorry - it was just not possible to follow up - thanks for your kindness and this great project |
Tries and apply what @kettanaito suggested to avoid logging an error when an unhandled rest request containing a query param would result in a confusing error message in the console
@kettanaito please let me know if this is what you meant and/or how this can be improved
thanks