More customizable errors would be nice
See original GitHub issueIt’s currently impossible to report errors whose message does not start with "Exception while fetching data: "
.
Overriding ExecutionStrategy.resolveField is a bad workaround (and see #208).
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Custom errors, extending Error - The Modern JavaScript Tutorial
JavaScript allows to use throw with any argument, so technically our custom error classes don't need to inherit from Error .
Read more >Creating Custom Errors in Go - DigitalOcean
Go provides two methods to create errors in the standard library, errors.New and fmt.Errorf . When communicating more complicated error ...
Read more >Custom Errors in Solidity
Custom errors are defined using the error statement, which can be used inside and outside of contracts (including interfaces and libraries).
Read more >How to handle custom error types | Smart Go - YouTube
Go's error handling system lets you create custom error types for use in your applications, which can contain detailed information about ...
Read more >Creating custom errors in Go (Golang) | golangbot.com
Adding more information to the error using Errorf. The above program works well but wouldn't it be nice if we print the actual...
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 Free
Top 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
FWIW, here’s a Jackson serializer (if anyone is using Jackson) for
ExecutionResult
that will skip printing the stacks if an error is anExceptionWhileDataFetching
:Implementation:
Test:
@dminkovsky thanks! I was looking for something similar. I won’t want risk exposing internals by showing a stacktrace. Your code worked fine except for one thing: Had to change if (!locations.isEmpty()) { into if (locations != null && !locations.isEmpty()) {
Or I’d get NPEs while serializing (in my case a dataFetcher threw an IllegalArgumentException), and “location” was null