chore: recognize 503 error in live requests

pull/151/head
Amio 2018-09-09 10:50:31 +08:00
rodzic e62ffd105e
commit f55cfc4868
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -31,10 +31,12 @@ const gotErrorHandler = (service, paramsPath, err) => {
const serviceKey = `/${service}/${paramsPath}` const serviceKey = `/${service}/${paramsPath}`
let status = 'unknown' let status = 'unknown'
if (err.statusCode === '404') { if (err.code === 'ETIMEDOUT') {
status = 'not found'
} else if (err.code === 'ETIMEDOUT') {
status = 'timeout' status = 'timeout'
} else if (err.statusCode === '404') {
status = 'not found'
} else if (err.statusCode === '503') {
status = 'unavailable'
} }
logError(serviceKey, err, status) logError(serviceKey, err, status)