A number of parameters are available for handling stderr and exit code in the JobSchedulerSSHJob job. These are:

  • ignore_stderr (default=false)

The job checks if any output to stderr has been created by a command that is being executed on the SSH server and reports this as an error. Should the value true be specified for this parameter then output to stderr will not be reported as an error by the JobScheduler.

  • ignore_error (default=false)

Should the value true be specified, then execution errors caused by commands on the SSH server are ignored. Otherwise such execution errors for jobs and orders are reported by the JobScheduler.

  • ignore_exit_code (default='')

This parameter configures one or more exit codes which will not be treated as errors. Multiple exit codes can be defined comma separated or using ranges. Examples: 255 2,3,4,100 4,50-60,210-220

  • raise_exception_on_error (default=true)

If any output to stderr has been created or the exit code is unequal 0 then the job usually throws an exception. Whenever the job throws an exception then its task ends with the exit code 1. If the job is started by an order and an exception is thrown then the order goes to the error node of the job chain. Should this value false be specified, then it prevents an exception is thrown, the task has the exit code of the command that is being executed on the SSH server and an order goes to the next node of the job chain.

 

The JobSchedulerSSHJob job creates the parameters

  • std_out_output

The output of the process into STDOUT is reported as the value of this parameter.

  • std_err_output

The output of the process into STDERR is reported as the value of this parameter.

  • exit_code

The exit code of the process is the value of this parameter. The exit code is zero if the process ended without any error.

If you use the JobSchedulerSSHJob job in a job chain then you can use these parameters in a next job of the job chain to handle the result.

 

As an example, we examine the command

ls _unknown_folder_; exit 5;

This command has a stderr = ls: _unknown_folder_: No such file or directory and the exit code 5.

ignore_stderrignore_errorraise_exception_on_errorExitCode of the
command
ExitCode of the
job's task
Order goes to...
falsefalsetrue51error node
truefalsetrue51error node
falsetruetrue51error node
truetruetrue50next node
falsefalsefalse55next node
truefalsefalse55next node
falsetruefalse55next node
truetruefalse50next node