#80 Issue closed: Add "StopIfFail" function to _input-output-functions.sh

Labels: support / question

djembe65 opened issue at 2012-05-21 21:03:

This is related to previous sourcforge Fix ID 3483371. Adding the StopIfFail function to the
/usr/share/rear/lib/_input-output-functions.sh. This function is used in the last line of the
/usr/share/rear/restore/NBU/default/40_restore_with_nbu.sh script. The function will issue a
failure if the exit code is higher than one. This is used because an Exit code of 1 on a bprestore does
not mean the whole restore is a failure. A temporary file not being restored will cause this exit code to happen.

Added code at Line 126 of the /usr/share/rear/lib/_input-output-functions.sh. script:

StopIfFail() {
# If return code is greater than 1, bail out
if (( $? > 1 )); then
Error "$@"
fi
}

dagwieers commented at 2012-05-23 13:31:

We decided not to implement StopIfFail because it is very specific (return code > 1) so we prefer to implement an exception rather than standardize it.

dagwieers commented at 2012-05-23 14:32:

Thanks for reporting !


[Export of Github issue for rear/rear.]