fix(route-utils): Adding handler for nginx 429 error

This commit is contained in:
Chris Troutner
2021-03-16 08:48:15 -07:00
parent 93811ca331
commit 27e5fb8728
+17
View File
@@ -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 {