fix(decodeError): Adding additional error handling

This commit is contained in:
Chris Troutner
2021-03-11 08:40:48 -08:00
parent 6540171263
commit 5650afb22f
+14
View File
@@ -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 {