Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… an empty object
  • Loading branch information...
commit 12e45e91a66ea00240892c858ae31ffe98e9d3b3 1 parent 56d6eb1
Ben Hughes authored February 19, 2012

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. 10  lib/posterous.js
10  lib/posterous.js
@@ -61,12 +61,14 @@ Posterous.prototype.request = function(method, api, args, callback) {
61 61
 
62 62
         if (r.error) {
63 63
           return callback(r.message || r.error);
64  
-        }
65  
-
66  
-        callback(null, r);
  64
+        }        
  65
+      
67 66
       } catch (err) {
68  
-        callback(null, {});
  67
+        return callback(err, null);
69 68
       }
  69
+      
  70
+      callback(null, r);
  71
+
70 72
     });
71 73
   });
72 74
 

0 notes on commit 12e45e9

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