From 7e437a53c538a8d1259ee45d28a428d419b8bb99 Mon Sep 17 00:00:00 2001 From: Kegan Myers Date: Tue, 4 Mar 2014 17:29:09 -0600 Subject: [PATCH] Javascript catch handling issue --- lib/Typertext/Http/HttpRequest.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Typertext/Http/HttpRequest.ts b/lib/Typertext/Http/HttpRequest.ts index 2a7b6a8..345bb28 100644 --- a/lib/Typertext/Http/HttpRequest.ts +++ b/lib/Typertext/Http/HttpRequest.ts @@ -78,9 +78,10 @@ module Typertext.Http { } else if (xhr.status >= 500 && xhr.status < 600) { //Again throw new HttpException("The server returned an error response state", xhr.status, new HttpResponse(HttpResponseStatus.serverError, getHeader, xhr.status, xhr.responseText)); + } else { + //And again + throw new HttpException("An unknown error has occurred", -2, new HttpResponse(HttpResponseStatus.unknownError, getHeader, xhr.status, xhr.responseText)); } - //And again - throw new HttpException("An unknown error has occurred", -2, new HttpResponse(HttpResponseStatus.unknownError, getHeader, xhr.status, xhr.responseText)); } };