Nate Coraor wrote, On 04/21/2010 01:58 PM:
Ry4an Brase wrote:
would change to
R --vanilla --slave $* < $infile 2>&1
While this would indeed fix the problem of the job failing, it'd prevent any failures from ever being detected. What we've done for tools that don't set a return code is attempt to parse the output for errors.
We use shell code similar to the following to temporarily store STDERR, and report it back to Galaxy based on the program's exit code: ======= #!/bin/sh # Temporary storage for STDERR TMP_STDERR=$(mktemp) || exit 1 # Run the program, send STDERR to temporary file MY_PROGRAM 2> $TMP_STDERR #check program's exit code if (( $? )); then #Program failed, send STDERR to real STDERR cat $TMP_STDERR >&2 rm $TMP_STDERR exit 1 fi #Program succeeded, delete STDERR file rm $TMP_STDERR exit 0 ======== -gordon