File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ const sendError = (error) => {
59
59
buttons : [ "OK" ] ,
60
60
title : "Error in download!" ,
61
61
message : "Argh! Apologies, download failed…" ,
62
- detail : error . toString ( ) ,
62
+ detail : ` ${ error . toString ( ) } ${ error . cause ? `\n\n ${ error . cause . toString ( ) } ` : '' } ` ,
63
63
} ) ;
64
64
} ;
65
65
@@ -89,6 +89,19 @@ async function downloadSong(
89
89
playlistFolder = undefined ,
90
90
trackId = undefined ,
91
91
increasePlaylistProgress = ( ) => { } ,
92
+ ) {
93
+ try {
94
+ await downloadSongUnsafe ( url , playlistFolder , trackId , increasePlaylistProgress ) ;
95
+ } catch ( error ) {
96
+ sendError ( error ) ;
97
+ }
98
+ }
99
+
100
+ async function downloadSongUnsafe (
101
+ url ,
102
+ playlistFolder = undefined ,
103
+ trackId = undefined ,
104
+ increasePlaylistProgress = ( ) => { } ,
92
105
) {
93
106
const sendFeedback = ( message , progress ) => {
94
107
if ( ! playlistFolder ) {
You can’t perform that action at this time.
0 commit comments