From 1392af21d076ec3aada94c198dcb13f64be7f13c Mon Sep 17 00:00:00 2001 From: Arun Rajkumar Date: Wed, 18 Oct 2023 11:51:14 +0530 Subject: [PATCH] handle migration failure gracefully --- source/util/migration_handler.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/util/migration_handler.ts b/source/util/migration_handler.ts index af3c344..235b90a 100644 --- a/source/util/migration_handler.ts +++ b/source/util/migration_handler.ts @@ -8,5 +8,9 @@ export async function applyMigrations(config: any): Promise { host: config['host'] || 'localhost', port: config['port'] || 5432, } - await migrate(dbConfig, __dirname + '/migrations') + try{ + await migrate(dbConfig, __dirname + '/migrations') + }catch(err){ + console.error(err); //if we are using typeorm and handling migration in base project, handle the exception + } }