From 2c977fbd7a9eae41f2eef967bf9ad9ce3c237903 Mon Sep 17 00:00:00 2001 From: lucaslinyker Date: Sat, 26 Jul 2025 15:48:08 -0300 Subject: [PATCH 1/2] feat: Implementar tratativa para o banco implementar tratativa para quando o banco estiver fora do ar --- src/app.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.ts b/src/app.ts index 48cbf3d..25a2768 100644 --- a/src/app.ts +++ b/src/app.ts @@ -53,6 +53,10 @@ app.setErrorHandler((error, _, reply) => { .send({ message: 'Validation error.', issues: error.format() }) } + if (error.message.includes("Can't reach database server")) { + return reply.status(503).send({ message: 'Database error.' }) + } + if (env.NODE_ENV !== 'prod') { console.error(error) } else { From 8312e31a0f6004a9bb0084c21d10bf0871bdaaff Mon Sep 17 00:00:00 2001 From: lucaslinyker Date: Sat, 26 Jul 2025 15:48:46 -0300 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20Adicionar=20configura=C3=A7=C3=B5e?= =?UTF-8?q?s=20ao=20.vscode/settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b6fc9e8..9623b34 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { + "files.eol": "\r\n", "editor.defaultFormatter": "biomejs.biome", "editor.formatOnSave": true, "files.autoSave": "off", @@ -8,5 +9,6 @@ "[prisma]": { "editor.defaultFormatter": "Prisma.prisma", "editor.formatOnSave": true - } + }, + "cSpell.words": ["bitnami", "zipcode"] }