Skip to content

Commit

Permalink
Resolved issue on error in many methods when an error is returned. Ca…
Browse files Browse the repository at this point in the history
…llback was attempting to parse invalid data
  • Loading branch information
Jeremiah Condon committed Aug 24, 2012
1 parent 2c5fa53 commit decef05
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions dbox.js
Expand Up @@ -61,7 +61,7 @@ exports.app = function(config){
"body": qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -79,7 +79,7 @@ exports.app = function(config){
"body": qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand Down Expand Up @@ -135,7 +135,7 @@ exports.app = function(config){
"body": body
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand Down Expand Up @@ -220,7 +220,7 @@ exports.app = function(config){
"url": "https://api.dropbox.com/1/revisions/" + (params.root || root) + "/" + qs.escape(path) + "?" + qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -245,7 +245,7 @@ exports.app = function(config){
"body": qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -270,7 +270,7 @@ exports.app = function(config){
"body": body
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -292,7 +292,7 @@ exports.app = function(config){
"body": body
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -314,7 +314,7 @@ exports.app = function(config){
"body": body
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -330,7 +330,7 @@ exports.app = function(config){
"url": "https://api.dropbox.com/1/copy_ref/" + (params.root || root) + "/" + qs.escape(path) + "?" + qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand Down Expand Up @@ -390,7 +390,7 @@ exports.app = function(config){
"body": qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -413,7 +413,7 @@ exports.app = function(config){
}

return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -433,7 +433,7 @@ exports.app = function(config){
"body": qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
},

Expand All @@ -453,7 +453,7 @@ exports.app = function(config){
"body": qs.stringify(params)
}
return request(args, function(e, r, b){
cb(e ? null : r.statusCode, JSON.parse(b))
cb(e ? null : r.statusCode, e ? null : JSON.parse(b))
})
}
}
Expand Down

0 comments on commit decef05

Please sign in to comment.