statusCodeType fix

This commit is contained in:
Roman Hotsiy 2015-12-12 18:30:13 +02:00
parent 8d91427206
commit baa7f27b9b

View File

@ -1,12 +1,15 @@
'use strict';
export function statusCodeType(statusCode) {
if (statusCode < 100 || statusCode > 599) {
throw 'invalid HTTP code';
}
let res = 'success';
if (statusCode >= 300 && statusCode < 400) {
res = 'redirect';
} else if (statusCode >= 400) {
res = 'error';
} else if (statusCode < 100) {
} else if (statusCode < 200) {
res = 'info';
}
return res;