From baa7f27b9b989e928c959d748114254868e37f9b Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sat, 12 Dec 2015 18:30:13 +0200 Subject: [PATCH] statusCodeType fix --- lib/utils/helpers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/utils/helpers.js b/lib/utils/helpers.js index fb59f42e..5a587850 100644 --- a/lib/utils/helpers.js +++ b/lib/utils/helpers.js @@ -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;