Fix error of status text

This commit is contained in:
sienori 2019-02-23 02:22:13 +09:00
parent 7a39dee3a1
commit 669073d64b

View file

@ -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;