diff --git a/examples/example_confidential_image/build_debian_image.sh b/examples/example_confidential_image/build_debian_image.sh index 3be89a77..c7a928df 100644 --- a/examples/example_confidential_image/build_debian_image.sh +++ b/examples/example_confidential_image/build_debian_image.sh @@ -18,7 +18,6 @@ cleanup() { return fi CLEANUP_DONE=true - echo "Cleaning up..." if mountpoint -q "${MOUNT_POINT}"; then sudo umount --recursive "${MOUNT_POINT}" || echo "Failed to unmount ${MOUNT_POINT}" fi @@ -43,6 +42,15 @@ cleanup() { # - TERM (SIGTERM): Signal 15, sent by the kill command to request the process to terminate gracefully. trap cleanup EXIT HUP INT QUIT PIPE TERM +error_handler() { + echo "" + echo "An error occured while building the image and the process was not completed properly." + echo "Please check the log, fix any error if required and restart the script." + echo "For more help see https://docs.aleph.im/computing/confidential/encrypted-disk/" +} + +trap error_handler ERR + usage() { cat <&2 Usage: