biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / build-support / setup-hooks / die.sh
blob0db41e030f4c219c79e06cc06e19d3ff42c53076
1 # Exit with backtrace and error message
3 # Usage: die "Error message"
4 die() {
5 # Let us be a little sloppy with errors, because otherwise the final
6 # invocation of `caller` below will cause the script to exit.
7 set +e
9 # Print our error message
10 printf "\nBuilder called die: %b\n" "$*"
11 printf "Backtrace:\n"
13 # Print a backtrace.
14 local frame=0
15 while caller $frame; do
16 ((frame++));
17 done
18 printf "\n"
20 exit 1