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.

Cannot catch GraphQL Errors

See original GitHub issue

I’m submitting a…

[x] Bug report [x] Documentation issue or request

Current behavior

Using the example provided in the documentation, when defining a module that uses the graphqlExpress middleware and using graphql-custom-types I can’t catch any kind of errors of the type GraphQLError. This means that cannot enforce or improve errors in this scenario.

Expected behavior

I can catch errors by type

Minimal reproduction of the problem with instructions

Following the GraphQL example and adding graphql-custom-types packages. When for example instantiating UUID in a query, this dispatcher never reaches the code.

import { GraphQLError } from 'graphql/error';

@Catch(GraphQLError)
export class DispatchError implements ExceptionFilter {
  public catch(err, res) {
    console.log('NEVER REACHES THIS POINT')
  }
}

What is the motivation / use case for changing the behavior?

Improve errors response depending Server needs.

Environment


Nest version: 4.6.6
 
For Tooling issues:
- Node version:  9.5.0
- Platform:  Mac

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
printjscommented, Jan 22, 2019

@fjcero ,I still have this problem

0reactions
lock[bot]commented, Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling operation errors - Apollo GraphQL Docs
Apollo Client can encounter a variety of errors when executing operations on your GraphQL server. Apollo Client helps you handle these errors according...
Read more >
Handling GraphQL errors like a champ with unions and ...
Error handling can be frustrating in GraphQL. This post shows you how to use unions and interfaces to handle errors in a more...
Read more >
GraphQL error handling to the max with Typescript, codegen ...
A GraphQL API will always return a 200 OK Status Code, even in case of error. You'll get a 5xx error in case...
Read more >
A Guide to GraphQL Errors
With top-level errors this can't be done since the whole mutation ... Make them even better with error codes so clients can handle...
Read more >
GraphQL Error Handling Best Practices for Security
The solution to catch these default errors before they get sent to the end-user is to use a custom formatError function in your...
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