exit node process on app init fail

This commit is contained in:
Simon Larsen 2023-10-04 19:22:25 +01:00
parent 01b677ec77
commit 2d4bb56ffa
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
15 changed files with 30 additions and 0 deletions

View File

@ -14,11 +14,13 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -13,11 +13,13 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -93,11 +93,13 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -13,11 +13,13 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -1019,10 +1019,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -42,10 +42,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -46,10 +46,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -22,11 +22,13 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -41,10 +41,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -49,10 +49,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -40,10 +40,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -18,11 +18,13 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -19,10 +19,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -121,10 +121,12 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});

View File

@ -73,11 +73,13 @@ const init: () => Promise<void> = async (): Promise<void> => {
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
throw err;
}
};
init().catch((err: Error) => {
logger.error(err);
logger.info('Exiting node process');
process.exit(1);
});