mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
fix(route-utils): Adding handler for nginx 429 error
This commit is contained in:
@@ -154,6 +154,23 @@ class RouteUtils {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle 429 errors thrown by nginx
|
||||
if (err.error) {
|
||||
console.log('decodeError: err: ', err)
|
||||
|
||||
if (err.error.includes('429 Too Many Requests')) {
|
||||
const internalMsg =
|
||||
'429 error thrown by nginx caught by route-utils.js/decodeError()'
|
||||
console.error(internalMsg)
|
||||
wlogger.error(internalMsg)
|
||||
|
||||
return {
|
||||
msg: '429 Too Many Requests',
|
||||
status: 429
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle general Error objects.
|
||||
if (err.message) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user