question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to remove "Context creation failed:" prefix from error messages

See original GitHub issue

Any 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

13reactions
abernixcommented, Aug 26, 2019

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 catching of errors within the context function.

9reactions
rdsedmundocommented, Apr 6, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found