From f55cfc4868420cd6e6ec195dcb728fba916b9ba8 Mon Sep 17 00:00:00 2001 From: Amio Date: Sun, 9 Sep 2018 10:50:31 +0800 Subject: [PATCH] chore: recognize 503 error in live requests --- libs/live-fetcher.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/live-fetcher.js b/libs/live-fetcher.js index d93a9be..4a6ddf1 100644 --- a/libs/live-fetcher.js +++ b/libs/live-fetcher.js @@ -31,10 +31,12 @@ const gotErrorHandler = (service, paramsPath, err) => { const serviceKey = `/${service}/${paramsPath}` let status = 'unknown' - if (err.statusCode === '404') { - status = 'not found' - } else if (err.code === 'ETIMEDOUT') { + if (err.code === 'ETIMEDOUT') { status = 'timeout' + } else if (err.statusCode === '404') { + status = 'not found' + } else if (err.statusCode === '503') { + status = 'unavailable' } logError(serviceKey, err, status)