fix(backups): preserve failure messages in alert JSON

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This commit is contained in:
Rudy Celekli
2026-10-07 17:00:16 -04:00
parent f99f6aa910
commit 61c75eede0
+4 -2
View File
@@ -305,9 +305,11 @@ handle_error() {
local error_message="$1"
log "ERROR: $error_message"
# Send notification
# Encode the message as JSON data: backup paths can contain quotes or newlines.
local payload
payload=$(python3 -c 'import json, sys; print(json.dumps({"text": "🚨 Backup Failed: " + sys.argv[1]}))' "$error_message")
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"🚨 Backup Failed: $error_message\"}" \
--data "$payload" \
"$NOTIFICATION_WEBHOOK"
exit 1