File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,16 +25,18 @@ async function main () {
2525 try {
2626 countries = await getCountries ( )
2727 } catch ( error ) {
28+ console . log ( error )
2829 console . log ( '--- No Countries were found, a restart is suggested ---' )
29- process . exit ( 0 )
30+ process . exit ( - 3 )
3031 }
3132
3233 let cities = [ ]
3334 try {
3435 cities = await getCities ( )
3536 } catch ( error ) {
37+ console . log ( error )
3638 console . log ( '--- No Cities were found, a restart is suggested ---' )
37- process . exit ( 0 )
39+ process . exit ( - 2 )
3840 }
3941
4042 const pool = new Pool ( config )
@@ -102,12 +104,12 @@ async function main () {
102104 . then ( res => {
103105 console . log ( res )
104106 } )
105- . catch ( err => console . log ( err ) )
107+ . catch ( err => { console . log ( err ) ; process . exit ( 1 ) } )
106108 . then ( process . exit ( 0 ) )
107109
108110 } catch ( error ) {
109111 console . log ( error )
110- process . exit ( 0 )
112+ process . exit ( 2 )
111113 }
112114}
113115
You can’t perform that action at this time.
0 commit comments