mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-12 01:36:57 +00:00
The changes affects multiple places in the repo and this one of the rare instances where I cant be bothered writing a comprehensive commit. Look at the diff for changes. Signed-off-by: Ronald Caesar <github43132@proton.me>
28 lines
645 B
Bash
28 lines
645 B
Bash
#!bin/bash
|
|
|
|
# Error handling function
|
|
error_handler() {
|
|
local exit_code=$?
|
|
local line_number=$1
|
|
log_critical "Script exited with code $exit_code at line $line_number"
|
|
log_critical "ABORT: Submodule setup failed - SYSTEM IN UNSTABLE STATE"
|
|
cleanup_on_failure
|
|
exit $exit_code
|
|
}
|
|
|
|
trap 'error_handler $LINENO' ERR
|
|
|
|
# Logging system
|
|
log() {
|
|
local level=$1
|
|
shift
|
|
local message="$*"
|
|
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
|
echo "[$timestamp] [$level] $message"
|
|
}
|
|
|
|
log_info() { log "INFO" "$*"; }
|
|
log_warn() { log "WARN" "$*"; }
|
|
log_error() { log "ERROR" "$*"; }
|
|
log_critical() { log "CRITICAL" "$*"; }
|
|
|