File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,5 +83,11 @@ function main(argv: string[]): void {
8383}
8484
8585if ( require . main === module ) {
86+ try {
8687 main ( process . argv . slice ( 2 ) ) ;
88+ } catch ( err ) {
89+ const message : string = err instanceof Error ? err . message : String ( err ) ;
90+ console . error ( `Error: ${ message } ` ) ;
91+ process . exit ( 1 ) ;
92+ }
8793}
Original file line number Diff line number Diff line change @@ -40,5 +40,11 @@ function main(argv: string[]): void {
4040}
4141
4242if ( require . main === module ) {
43+ try {
4344 main ( process . argv . slice ( 2 ) ) ;
45+ } catch ( err ) {
46+ const message : string = err instanceof Error ? err . message : String ( err ) ;
47+ console . error ( `Error: ${ message } ` ) ;
48+ process . exit ( 1 ) ;
49+ }
4450}
Original file line number Diff line number Diff line change @@ -54,4 +54,10 @@ function main(args: string[]): void {
5454}
5555
5656const args = process . argv . slice ( 2 ) ;
57+ try {
5758main ( args ) ;
59+ } catch ( err ) {
60+ const message : string = err instanceof Error ? err . message : String ( err ) ;
61+ console . error ( message ) ;
62+ process . exit ( 1 ) ;
63+ }
You can’t perform that action at this time.
0 commit comments