mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Use pino error instead of fatal
Fatal throws flushing error when using 'pretty' log style
This commit is contained in:
@@ -55,7 +55,7 @@ export default async function createApp() {
|
||||
await validateDBConnection();
|
||||
|
||||
if ((await isInstalled()) === false) {
|
||||
logger.fatal(`Database doesn't have Directus tables installed.`);
|
||||
logger.error(`Database doesn't have Directus tables installed.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ export async function validateDBConnection() {
|
||||
try {
|
||||
await hasDatabaseConnection();
|
||||
} catch (error) {
|
||||
logger.fatal(`Can't connect to the database.`);
|
||||
logger.fatal(error);
|
||||
logger.error(`Can't connect to the database.`);
|
||||
logger.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export default async function start() {
|
||||
})
|
||||
.once('error', (err: any) => {
|
||||
if (err?.code === 'EADDRINUSE') {
|
||||
logger.fatal(`Port ${port} is already in use`);
|
||||
logger.error(`Port ${port} is already in use`);
|
||||
process.exit(1);
|
||||
} else {
|
||||
throw err;
|
||||
|
||||
@@ -16,7 +16,7 @@ export function validateEnv(requiredKeys: string[]) {
|
||||
|
||||
for (const requiredKey of requiredKeys) {
|
||||
if (env.hasOwnProperty(requiredKey) === false) {
|
||||
logger.fatal(`Environment is missing the ${requiredKey} key.`);
|
||||
logger.error(`"${requiredKey}" Environment Variable is missing.`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user