diff options
Diffstat (limited to 'lib/caldav/request/abstract.js')
-rw-r--r-- | lib/caldav/request/abstract.js | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/lib/caldav/request/abstract.js b/lib/caldav/request/abstract.js index 6f33af4..acc91cc 100644 --- a/lib/caldav/request/abstract.js +++ b/lib/caldav/request/abstract.js @@ -2,20 +2,6 @@ var SAX = ns.require('sax'); var XHR = ns.require('xhr'); - var Errors = ns.require('errors'); - - function determineHttpStatusError(status) { - var message = 'Cannot handle request due to server response'; - var err = 'Unknown'; - - if (status === 500) - err = 'ServerFailure'; - - if (status === 401) - err = 'Authentication'; - - return new Errors[err](message); - } /** * Creates an (Web/Cal)Dav request. @@ -85,19 +71,8 @@ return callback(err); } - // handle the success case - if (xhr.status > 199 && xhr.status < 300) { - self.sax.close(); - return self._processResult(req, callback); - } - - // probable error cases - callback( - determineHttpStatusError(xhr.status), - xhr - ); - - + self.sax.close(); + return self._processResult(req, callback); }); return req; |