Permalink
Browse files

shift successful get/post callback into try block

  • Loading branch information...
1 parent 0f98687 commit 8dbb12d2c7c208193229cb4fda2f6e5626218149 @jdub committed Oct 17, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/node-twitter/index.js
@@ -81,10 +81,10 @@ Twitter.prototype.get = function(url, params, callback) {
} else {
try {
var json = JSON.parse(data);
+ callback(json);
} catch(error) {
callback(error);
}
- callback(json);
}
});
return this;
@@ -119,10 +119,10 @@ Twitter.prototype.post = function(url, content, content_type, callback) {
} else {
try {
var json = JSON.parse(data);
+ callback(json);
} catch(error) {
callback(error);
}
- callback(json);
}
});
return this;

0 comments on commit 8dbb12d

Please sign in to comment.