Skip to content

Commit e725109

Browse files
committed
Try catch when downloadnig
1 parent f6d5270 commit e725109

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nodescriptsTS/src/util.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ const downloadFile = async (url:string, dest:string) => {
7878
console.log("Downloading file from URL: ")
7979
console.log(url);
8080
const wget = require('node-wget-promise');
81-
return await wget(url, {output: dest})
81+
try{
82+
return await wget(url, {output: dest})
83+
}
84+
catch(e){
85+
console.log("Error downloading File:")
86+
console.log(e)
87+
}
88+
8289
}
8390

8491
const isFirstCharNum = (str:string) => {

0 commit comments

Comments
 (0)