File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,14 @@ interface BootstrapResult {
20
20
shutdown : ( ) => void ;
21
21
}
22
22
23
+ const logger = getLogger ( "bootstrap" ) ;
24
+
23
25
// Main entrypoint to the application, where all the startup logic is defined.
24
26
// This function is immediately invoked when the file is imported.
25
27
// For testing purposes, the function is exported and provides some helpers.
26
28
export const bootstrap = ( async ( ) : Promise < BootstrapResult > => {
27
29
// Load the configuration first to make sure it's valid.
28
30
const config = getConfig ( ) ;
29
- const logger = getLogger ( "bootstrap" ) ;
30
31
31
32
const server = new Server ( ) ;
32
33
@@ -61,4 +62,7 @@ export const bootstrap = (async (): Promise<BootstrapResult> => {
61
62
server,
62
63
shutdown : ( ) => server ?. close ( ) ,
63
64
} ;
64
- } ) ( ) ;
65
+ } ) ( ) . catch ( ( error ) => {
66
+ logger . error ( { error } , "Failed to start server" ) ;
67
+ process . exit ( 1 ) ;
68
+ } ) ;
You can’t perform that action at this time.
0 commit comments