chore: database connection error log

This commit is contained in:
ChengLei Shao 2023-08-22 09:01:29 +08:00
parent 0532d67e0b
commit 9c5f630ae7

View File

@ -708,6 +708,7 @@ export class Database extends EventEmitter implements AsyncEmitter {
console.log('Connection has been established successfully.'); console.log('Connection has been established successfully.');
return true; return true;
} catch (error) { } catch (error) {
console.log(`Unable to connect to the database: ${error.message}`);
if (count >= (retry as number)) { if (count >= (retry as number)) {
throw new Error('Connection failed, please check your database connection credentials and try again.'); throw new Error('Connection failed, please check your database connection credentials and try again.');
} }