From e78151acc6ad21d83e4a323b794b483e192bc0b8 Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Wed, 6 Nov 2024 15:30:47 -0500 Subject: [PATCH] fix(core): catch error on aws backup storage client creation --- core/api/src/app/admin/backup.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/api/src/app/admin/backup.ts b/core/api/src/app/admin/backup.ts index 9b8a98ddd5..0cf91994bc 100644 --- a/core/api/src/app/admin/backup.ts +++ b/core/api/src/app/admin/backup.ts @@ -92,14 +92,14 @@ export const uploadBackup = }, }, async () => { - const client = new S3Client({}) - const command = new PutObjectCommand({ - Bucket: LND_SCB_BACKUP_BUCKET_NAME, - Key: `lnd_scb/${filename}`, - Body: backup, - ContentMD5: createHash("md5").update(backup).digest("base64"), - }) try { + const client = new S3Client({}) + const command = new PutObjectCommand({ + Bucket: LND_SCB_BACKUP_BUCKET_NAME, + Key: `lnd_scb/${filename}`, + Body: backup, + ContentMD5: createHash("md5").update(backup).digest("base64"), + }) client.send(command) logger.info({ backup }, "Static channel backup to AWS successful.") addEventToCurrentSpan("Static channel backup to AWS successful.")