Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

then the calling script traps this return code and calls ERROR (ecflow_client --abort)

Code Block
ERROR() {
trap 0
ecflow_client --abort $$
exit 1
}
trap ERROR 0 $SIGNAL_LIST
# ...
function call {
 trap '{ echo "Error in function"; exit 1; }' 0 $SMS_SIGNAL$SIGNAL_LIST
 set -ex
 # ...
}# ...calltrap 0; ecflow_client --complete ; exit 0

In the next example, exit 1 will directly exit the script, so that we have to call ecflow_client to report the abort to the server.

Code Block
call() {
trap '{ ecflow_client --abort $$; exit 1; }' 0 $SMS_SIGNAL$SIGNAL_LIST
 set -ex
}