Skip to content

Commit a8afcbb

Browse files
committed
More specific error message
And fix issue with some SSL sites, re: http://stackoverflow.com/questions/12021578/phantomjs-failing-to-open-ht tps-site
1 parent dd39941 commit a8afcbb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ function mergeSettings(settings){
6565
// @see http://phantomjs.org/api/command-line.html
6666
cli: {
6767
'--max-disk-cache-size' : '0',
68-
'--disk-cache' : 'false'
68+
'--disk-cache' : 'false',
69+
'--ignore-ssl-errors' : 'yes'
6970
},
7071
// webpage settings
7172
// @see http://phantomjs.org/api/webpage/

phantomjs/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ function createPage(url, options, onload){
161161
};
162162
page.onResourceError = function(req){
163163
log('resource [' + req.url + '] error', _.log.WARNING);
164+
page.errorReason = req.errorString;
164165
callback();
165166
};
166167
page.onError = function(msg, trace){
@@ -189,7 +190,7 @@ function createPage(url, options, onload){
189190
if(status === 'success'){
190191
callback();
191192
} else {
192-
log('load page error [' + status + ']', _.log.ERROR);
193+
log('load page error [' + page.errorReason + ']', _.log.ERROR);
193194
phantom.exit(1);
194195
}
195196
});

0 commit comments

Comments
 (0)