mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-10-20 01:55:11 +00:00
fix(backups): preserve failure messages in alert JSON
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user