All Projects → codesuki → superagent-intercept

codesuki / superagent-intercept

Licence: MIT license
Add functions that will be called during end() e.g. for handling error conditions without having the same code all over the place.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to superagent-intercept

Fee-movie2.0
整合了几个常用的电影网站,获取资源更方便,更新中
Stars: ✭ 33 (+43.48%)
Mutual labels:  superagent
kotlin-multiplatform-example
A Kotlin multiplatform example app that targets Android, ReactJS, iOS, JavaFx, and Spring Boot
Stars: ✭ 115 (+400%)
Mutual labels:  error-handling
retryx
Promise-based retry workflow library.
Stars: ✭ 21 (-8.7%)
Mutual labels:  error-handling
raygun4py
Python provider for Raygun
Stars: ✭ 18 (-21.74%)
Mutual labels:  error-handling
nested-error-stacks
A node.js module for creating Error objects with nested Errors in stacktraces
Stars: ✭ 86 (+273.91%)
Mutual labels:  error-handling
node-graceful-shutdown
Gracefully shutdown your modular NodeJS application.
Stars: ✭ 20 (-13.04%)
Mutual labels:  error-handling
fortran-error-handler
Comprehensive error framework for applications requiring functional and robust error handling, utilising the power of modern object-oriented Fortran.
Stars: ✭ 19 (-17.39%)
Mutual labels:  error-handling
bugsnag
Report errors with Bugsnag 🐛
Stars: ✭ 37 (+60.87%)
Mutual labels:  error-handling
of
🍬 Promise wrapper with sugar 🍬
Stars: ✭ 13 (-43.48%)
Mutual labels:  error-handling
babel-errors
Nicer error messages for Babel
Stars: ✭ 15 (-34.78%)
Mutual labels:  error-handling
grpc-apm-spring-boot-starter
Spring boot starter for gRPC framework with Elastic APM
Stars: ✭ 18 (-21.74%)
Mutual labels:  interceptor
logging-interceptor
CDI interceptor for logging to slf4j
Stars: ✭ 25 (+8.7%)
Mutual labels:  interceptor
friendly-error
Show uncaught errors friendly in Node.js.
Stars: ✭ 75 (+226.09%)
Mutual labels:  error-handling
optionals
Rust-like error handling and options for TypeScript and Deno!
Stars: ✭ 97 (+321.74%)
Mutual labels:  error-handling
custom-exception-middleware
Middleware to catch custom or accidental exceptions
Stars: ✭ 30 (+30.43%)
Mutual labels:  error-handling
Cauldron
C# Toolkit
Stars: ✭ 68 (+195.65%)
Mutual labels:  interceptor
custom error
Define custom errors without boilerplate using the custom_error! macro.
Stars: ✭ 70 (+204.35%)
Mutual labels:  error-handling
result17
A rust like Result type for modern C++
Stars: ✭ 13 (-43.48%)
Mutual labels:  error-handling
static-404
⚡️ A WordPress plugin to quickly send a 404 for missing static files
Stars: ✭ 24 (+4.35%)
Mutual labels:  error-handling
safe
🛡 PHP functions smarten up to throw exceptions instead of returning false or triggering errors.
Stars: ✭ 15 (-34.78%)
Mutual labels:  error-handling

superagent-intercept

Add interceptors that will be called during end() e.g. for handling error conditions without having the same code all over the place.

Support

Please consider supporting the project by starring it on GitHub :)

https://github.com/codesuki/superagent-intercept

Install

npm install superagent-intercept

Example

let AuthIntercept = require('superagent-intercept')((err, res) => {
	if (res.status == 401) {
	   // route to login
	}
});

request.get('/api/something/' + someId).use(AuthIntercept).end((err, res) {
	// AuthIntercept will be called here.
	// ... code ...
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].