traps#
Basic EXIT/INT/TERM traps with error reporting.
Functions#
- cleanup
-
Purpose: Trap handler that prints a non-zero exit code via
log_errorwhen a script exits with failure. -
setup_traps
- Purpose: Install traps:
EXIT->cleanup,INT-> prints interrupt and exits 130,TERM-> prints terminated and exits 143.
Notes#
- Import
loggingto format trap errors as styled logs.