aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-06-26 12:32:44 +0200
committerJames Lal <james@lightsofapollo.com>2012-06-26 12:32:44 +0200
commit10900e01370c1fd4d147168cdc30ed81a77dcf44 (patch)
tree83caaf47fe5774aafa8ee14240b3bc64f9d22e09 /lib
parent95fe95710b81d14dda2a3b77281f1fe65f703ef3 (diff)
downloadjsCalDAV-10900e01370c1fd4d147168cdc30ed81a77dcf44.tar.gz
move result logic into overridable method
Diffstat (limited to 'lib')
-rw-r--r--lib/webcals/request/abstract.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/webcals/request/abstract.js b/lib/webcals/request/abstract.js
index 4d549c2..c90b960 100644
--- a/lib/webcals/request/abstract.js
+++ b/lib/webcals/request/abstract.js
@@ -51,6 +51,10 @@
return '';
},
+ _processResult: function(callback, req) {
+ callback.call(this, null, this.sax.root, req);
+ },
+
/**
* Sends request to server.
*
@@ -69,8 +73,7 @@
if (xhr.status > 199 && xhr.status < 300) {
// success
self.sax.write(xhr.responseText).close();
-
- callback(null, self.sax.root, req);
+ self._processResult(callback, req);
} else {
// fail
callback(new Error('http error code: ' + xhr.status));