mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
fix(decodeError): Adding additional error handling
This commit is contained in:
@@ -175,6 +175,20 @@ function decodeError (err) {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle 429 errors thrown by nginx
|
||||
if (err.error) {
|
||||
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