diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-06 22:22:52 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-06 22:22:52 +0400 |
commit | a43cae6db06688d289eea9a8474dae563f66bc13 (patch) | |
tree | ab7d43f3ebfd60d1d86900599a7ef42955a73e18 /tests/lib | |
parent | 0a983024f0845a4f29e6c8bbc492858b7968b39e (diff) |
Refs #4739, pass along errors to callback in testEnvironment Piwik API/Controller calls.
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/screenshot-testing/support/test-environment.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/lib/screenshot-testing/support/test-environment.js b/tests/lib/screenshot-testing/support/test-environment.js index 0bdb52cc21..7130207c38 100644 --- a/tests/lib/screenshot-testing/support/test-environment.js +++ b/tests/lib/screenshot-testing/support/test-environment.js @@ -66,11 +66,13 @@ TestingEnvironment.prototype._call = function (params, done) { try { response = JSON.parse(response); } catch (e) { - throw new Error("Unable to parse JSON response: " + response); + done(new Error("Unable to parse JSON response: " + response)); + return; } if (response.result == "error") { - throw new Error("API returned error: " + response.message); + done(new Error("API returned error: " + response.message)); + return; } } |