Commit 2e873d2a authored by Nigel Cunningham's avatar Nigel Cunningham Committed by Gerrit Code Review
Browse files

(Bug 1318432) Ensure errorhandler called



In sendjsonrequest, if the request completes but returns an error,
we should invoke the caller's error handling function.

Change-Id: I52ef8ae900796c5db4532fa11c2a152d8a75b838
Signed-off-by: default avatarNigel Cunningham <nigelc@catalyst-au.net>
parent 57035b28
......@@ -256,12 +256,14 @@ function sendjsonrequest(script, data, rtype, successcallback, errorcallback, qu
}
else if (data.error == 'local') {
errtype = 'error';
errorcallback();
}
else {
logWarning('invoking globalErrorHandler(', data, this, arguments, ')');
// Trying something ninja. The call failed, but in the event that the global error
// handler can recover, maybe it can be called
globalErrorHandler(data);
errorcallback();
}
if (errtype) {
if (typeof(data.message) == 'string') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment