No way to remove "Context creation failed:" prefix from error messages
See original GitHub issueAny error thrown in the context
have a Context creation failed:
prefix, even in production environment.
Current workaround of using formatError
and stripping off the prefix there, feels hacky.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Migrating to Apollo Server 4 - Apollo GraphQL Docs
In Apollo Server 3, if your context function throws, then the string "Context creation failed: " is always prepended to its message, and...
Read more >How to handle errors that are from "context creation" ? : r/graphql
So my token has expired. And within the context I check the "token" from HTTP Header and throw an error when it's not...
Read more >Why am I seeing `context deadline exceeded` errors
The error 'context deadline exceeded' means that we ran into a situation where a given action was not completed in an expected timeframe....
Read more >Spring Boot - Error creating bean with name 'dataSource ...
Looks like the initial problem is with the auto-config. If you don't need the datasource, simply remove it from the auto-config process:
Read more >How to Add Extra Information to Errors in Go - DigitalOcean
Errorf to create error values you returned from a function. You also added an error handler to print out the error message when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is by design to ensure that unhandled exceptions are handled by user code. This is a catch-all that we’re putting in place to help guide you to the site of the error.
You can and should avoid this by doing own
catch
ing of errors within thecontext
function.The Apollo Server docs itself shows an example where an error is thrown inside the context for API-wide authorization. This extra message is disruptive and doesn’t help with anything, especially if you’re using a second language that is not English for the error message. The stack trace already points out where the error was thrown, so it’s completely useless.
Can this please be reconsidered? @glasser @abernix