Skip to content

Commit 1f83d88

Browse files
committed
fix: fix init-countries
1 parent 055136b commit 1f83d88

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/init-countries.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)