From 669073d64b58882c572d79c15f46d029d6606e86 Mon Sep 17 00:00:00 2001 From: sienori Date: Sat, 23 Feb 2019 02:22:13 +0900 Subject: [PATCH] Fix error of status text --- src/common/translate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/translate.js b/src/common/translate.js index b21e76b..65f18f0 100644 --- a/src/common/translate.js +++ b/src/common/translate.js @@ -52,7 +52,11 @@ const formatResult = result => { statusText: "" }; - resultData.statusText = result.statusText; + if (result.status === 0) resultData.statusText = "Network Error"; + else if (result.status === 200) resultData.statusText = "OK"; + else if (result.status === 503) resultData.statusText = "Service Unavailable"; + else resultData.statusText = result.statusText || result.status; + if (resultData.statusText !== "OK") { log.error(logDir, "formatResult()", resultData); return resultData;