Skip to content

Commit 921f0b1

Browse files
committed
Fixed error formatting in error responses.
1 parent 6f6fcde commit 921f0b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

phantom-scrape.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var consoleLogs = [];
1010
phantom.onError = page.onError = function(){};
1111

1212
function exitWithError(message) {
13-
outputJSON({error: message});
13+
outputJSON({error: {message: message}});
1414
phantom.exit();
1515
}
1616

scrape.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function scrape(url, options) {
3434
error = response.error;
3535
}
3636
if (error) {
37-
reject(objectAssign(new Error(), error));
37+
reject(objectAssign(new Error(error.message), error));
3838
} else if (!response) {
3939
reject(new Error("Empty scraped response."));
4040
} else {

0 commit comments

Comments
 (0)