How to use correctly error-handling set -euo pipefail