Permalink
Browse files

Returning error from JSON parsing, rather than swallowing + returning…

… an empty object
  • Loading branch information...
1 parent 56d6eb1 commit 12e45e91a66ea00240892c858ae31ffe98e9d3b3 @benrhughes benrhughes committed Feb 19, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/posterous.js
View
@@ -61,12 +61,14 @@ Posterous.prototype.request = function(method, api, args, callback) {
if (r.error) {
return callback(r.message || r.error);
- }
-
- callback(null, r);
+ }
+
} catch (err) {
- callback(null, {});
+ return callback(err, null);
}
+
+ callback(null, r);
+
});
});

0 comments on commit 12e45e9

Please sign in to comment.