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.

Upgrade cause loss of originalError

See original GitHub issue

We are upgrading to latest graphql and express graphql in our Node app from very old versions (graphql 0.8, graphqlexpress 0.7). In doing so we lose the error response data in our underlying api calls graphql is making. I traced the issue here.

https://github.com/graphql/graphql-js/blob/d85fc1186cca57fd3a74b93601a297e811b4bb13/src/execution/execute.js#L715

At one point in the older releases, an error object with a nested originalError was returned. Now instead I get only a string back.

If instead of doing new Error(error.errorString) the code would call new GraphQLError(...,...,...,error) where error is the originalError part, then I can extract the data from my error object in the graphql express module as referenced here : https://github.com/graphql/express-graphql/blob/master/README.md#debugging-tips

At one point the code must have returned an error that wrapped the originalError object and now it does not, it only returns an error that wraps a string.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yaacovCRcommented, Oct 8, 2019

You should just make sure your custom error object inherits from Error? Maybe share the format of that object?

0reactions
purpleD17commented, Oct 15, 2019

Yes I’ll do that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Re-throwing exception in NodeJS and not losing stack trace
The problem with creating a new Error is you can lose metadata that was attached to the original Error that was thrown, the...
Read more >
Get help with Windows upgrade and installation errors
See some of the most common upgrade and installation errors for Windows 10 and Windows 11, and what you can do to try...
Read more >
How to upgrade Junos on the TX Matrix Plus Router when RE ...
Logon to the Primary Routing Engine on the TX Matrix Plus router. Disable Routing Engine Redundancy and GRES on the Routing Matrix. Install...
Read more >
Guide to Updating and Upgrading BIG-IP - F5 Networks
Both updates and upgrades require upfront planning and systematic execution. Overview. This document guides you through the steps to update or ...
Read more >
Asmin import issue what does this mean "original error: Requested ...
Can someone explain what this error is saying and where I might look to correct it? I'm at a loss in trying to...
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