Skip to content
Browse files

FIX: don't return callback twice. Thanks @wefarrell for noticing.

  • Loading branch information...
1 parent 12e87c7 commit 4200d728fc2bdbe72a81b83c968154a4b26fbe52 @infynyxx infynyxx committed Jun 25, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/sailthru.js
  2. +1 −1 src/sailthru.coffee
View
4 lib/sailthru.js
@@ -91,15 +91,15 @@
try {
json_response = JSON.parse(body);
if (statusCode === 200) {
- callback(json_response);
+ return callback(json_response);
} else {
json_err = {
statusCode: statusCode,
error: json_response.error,
errormsg: json_response.errormsg
};
+ return callback(json_response, json_err);
}
- return callback(json_response, json_err);
} catch (error) {
json_err = {
statusCode: 0,
View
2 src/sailthru.coffee
@@ -78,7 +78,7 @@ class SailthruRequest
error: json_response.error
errormsg: json_response.errormsg
- callback json_response, json_err
+ callback json_response, json_err
catch error
json_err =
statusCode: 0,

0 comments on commit 4200d72

Please sign in to comment.
Something went wrong with that request. Please try again.