From 2044d11590cef021e0072bf532330cc46493e727 Mon Sep 17 00:00:00 2001 From: martmull Date: Fri, 23 Aug 2024 17:02:38 +0200 Subject: [PATCH] Catch error on synchrone context --- .../integrations/serverless/drivers/local.driver.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/twenty-server/src/engine/integrations/serverless/drivers/local.driver.ts b/packages/twenty-server/src/engine/integrations/serverless/drivers/local.driver.ts index 60933461b100..512cd1f82fda 100644 --- a/packages/twenty-server/src/engine/integrations/serverless/drivers/local.driver.ts +++ b/packages/twenty-server/src/engine/integrations/serverless/drivers/local.driver.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { join } from 'path'; import { tmpdir } from 'os'; import { promises as fs } from 'fs'; @@ -137,7 +138,7 @@ export class LocalDriver }); } child.kill(); - fs.unlink(tmpFilePath); + fs.unlink(tmpFilePath).catch(console.error); }); child.stderr?.on('data', (data) => { @@ -169,19 +170,19 @@ export class LocalDriver }, }); child.kill(); - fs.unlink(tmpFilePath); + fs.unlink(tmpFilePath).catch(console.error); }); child.on('error', (error) => { reject(error); child.kill(); - fs.unlink(tmpFilePath); + fs.unlink(tmpFilePath).catch(console.error); }); child.on('exit', (code) => { if (code && code !== 0) { reject(new Error(`Child process exited with code ${code}`)); - fs.unlink(tmpFilePath); + fs.unlink(tmpFilePath).catch(console.error); } });