Apollo Link onError should provide access to stack trace #436
Labels
core
Feature requests related to core functionality
🔗 apollo-link
Feature requests related to Apollo Link behavior
When handling errors in https://www.apollographql.com/docs/react/api/link/apollo-link-error/, there is no ability to determine the stack trace of the error that includes the original trigger for the query.
This is problematic both when logging errors locally, and reporting helpful errors to tools like Sentry.io, which accept Error objects and present stack traces helpfully.
Raising a new Error object from within an onError handler doesn't work, presumably because of the callback nature of the handler.
The only workaround I've found is to implement a separate link that populates the stack into the context:
This is not ideal as it wastefully records the stack for every request, even if no error occurs.
This gap has been raised several times, but I don't believe it's currently captured as a feature request here:
The text was updated successfully, but these errors were encountered: