Skip to content

Commit

Permalink
error
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardTMiles committed Jul 13, 2024
1 parent 123b354 commit a2e7527
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/assets/shell/getAmazonCertificateManagerSSL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
cd "$SCRIPT_DIR" || exit 55
cd ../../..

# Source error trapping script
source ./Assets/shell/trapError.sh


err() {
IFS=' ' read line file <<< "$(caller)"
ERROR_MESSAGE="$( echo -e "Error occurred with status ($2) on/near ($(caller)) trapped in ($0):\n" &&
awk 'NR>L-4 && NR<L+4 { printf "%-5d%3s%s\n",NR,(NR==L?">>>":""),$file }' L="$line" "$file" )"
echo -e "$ERROR_MESSAGE"
exit "$2"
}
trap 'err $LINENO $?' ERR

# Fetch certificate ARNs from AWS
CERTIFICATES=$(aws acm list-certificates ${LOCAL:+"--profile nonprod"} --query 'CertificateSummaryList[*].CertificateArn' --output text | sed 's/[[:space:]]/,/g')
Expand Down

0 comments on commit a2e7527

Please sign in to comment.