Files
duplicati/pipeline/docker-run/error_handling.sh
T
verhoek 49db5035a8 Imported duplicatipipeline scripts
Added bash scripts to run the dockerized build and test environment
2019-12-02 21:35:39 +01:00

18 lines
392 B
Bash

#!/bin/bash
function quit_on_error() {
local parent_lineno="$1"
local message="$2"
local code="${3:-1}"
if [[ -n "$message" ]] ; then
echo "Error in $0 line ${parent_lineno}: ${message}; exiting with status ${code}"
else
echo "Error in $0 line ${parent_lineno}; exiting with status ${code}"
fi
exit "${code}"
}
set -eE
trap 'quit_on_error $LINENO' ERR
set -o pipefail