add opt-in global error-handling (by default)
See original GitHub issuethis gets redundant on the client:
request
.get('/querystring')
.query('search=Manny')
.query({ order: 'desc', range: '1..5' })
.end(function(res){
if (res.error) return something(res.error)
});
ideally you opt in with something similar to:
request.on('error', function(err){
});
though this would be a bit of a hack since we have no .error(fn)
to opt-into http errors in the first place. Arguably global handling is an anti-pattern but worth thinking about
Issue Analytics
- State:
- Created 11 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
add opt-in global error-handling (by default) #165 - GitHub
A great use case for this in-browser would be global handling of 401 errors to force the user to sign in again.
Read more >Handle errors in ASP.NET Core | Microsoft Learn
NET Core apps enable the developer exception page by default when both: ... UseExceptionHandler adds the exception handling middleware in ...
Read more >Global Error Handling in ASP.NET Core Web API - Code Maze
In this article, we are going to handle errors by using a try-catch block first and then rewrite our code by using built-in...
Read more >Error Handling for REST with Spring - Baeldung
This tutorial will illustrate how to implement Exception Handling with Spring for a REST API. We'll also get a bit of historical overview...
Read more >Complete Guide to Exception Handling in Spring Boot
Spring Boot's Default Exception Handling Mechanism ... Spring Boot provides some properties with which we can add the exception message, ...
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
An example of quick and dirty workaround:
I believe
.end
is not supported by superagent-defaults.