Error handler

 trap 'echo "ERROR on line $LINENO"; exit 1' ERR 

This line is an error handler (or an exception catcher). It tells Bash: “The very moment any command fails, run this specific piece of code before you shut down.”

Anatomy of the Command

#!/bin/bash
set -euo pipefail
trap 'echo "ERROR on line $LINENO"; exit 1' ERR

cd /non_existent_folder
echo "Moving on..."