Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Use exit code 5 for wrong arguments
Browse files Browse the repository at this point in the history
It seems that 1 may be used by PhantomJS itself
  • Loading branch information
jonnor committed Aug 27, 2016
1 parent e4669d1 commit 58f8f0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/phantomjs-loadpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var page = require('webpage').create();
/// Parse commandline options
if (system.args.length === 1) {
console.log('Usage: loadpage.js <some URL>');
phantom.exit(1);
phantom.exit(5);
}
var address = system.args[1];

Expand Down
3 changes: 2 additions & 1 deletion src/runner.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,11 @@ class Runner

# Mapping of exit code to error. Needs to match behavior of ../bin/phantomjs-loadpage.js
phantomErrors =
1: 'Wrong arguments'
1: 'Unknown PhantomJS error'
2: 'Failed to open solver page'
3: 'Soft timeout'
4: 'Uncaught JavaScript Error'
5: 'Wrong arguments to JsJob script'

# TODO/PERF: use WebDriver mode and keep a long-running phantomjs instance
class PhantomProcess
Expand Down

0 comments on commit 58f8f0b

Please sign in to comment.