diff options
Diffstat (limited to 'httprpc.js')
-rw-r--r-- | httprpc.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/httprpc.js b/httprpc.js index ef29133e8..e738e1f0f 100644 --- a/httprpc.js +++ b/httprpc.js @@ -40,7 +40,8 @@ return { _id: object.id, - data: object.result + data: object.result, + error: object.error }; }; @@ -70,7 +71,7 @@ var self = this; this.sendRequest(payload, function (request) { var parsed = JSON.parse(request.responseText); - if (parsed.result instanceof Array ? parsed.result.length === 0 : !parsed.result) { + if (parsed.error || (parsed.result instanceof Array ? parsed.result.length === 0 : !parsed.result)) { return; } self.handlers.forEach(function (handler) { |