aboutsummaryrefslogtreecommitdiffstats
path: root/lib/httprpc.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/httprpc.js')
-rw-r--r--lib/httprpc.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/httprpc.js b/lib/httprpc.js
index c1ee0f02a..99f02b532 100644
--- a/lib/httprpc.js
+++ b/lib/httprpc.js
@@ -45,7 +45,8 @@ if(process.env.NODE_ENV !== "build") {
return {
_id: object.id,
- data: object.result
+ data: object.result,
+ error: object.error
};
}
@@ -75,7 +76,7 @@ if(process.env.NODE_ENV !== "build") {
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) {