diff --git a/src/client/components/downloaders/Spotify.ts b/src/client/components/downloaders/Spotify.ts index 1d2c11d..433ef64 100644 --- a/src/client/components/downloaders/Spotify.ts +++ b/src/client/components/downloaders/Spotify.ts @@ -132,13 +132,13 @@ class SpotifyDownloader extends Downloader this.logger.debug('Got ID mismatch, attempting to parse stdout to find filename'); const match = stdout.match(reg); if (!match) - throw new Error('Got bad output from zotify (could not find file name) and could not find by ID from cache file'); + return reject(new Error('Got bad output from zotify (could not find file name) and could not find by ID from cache file')); const { file, name } = match.groups!; fs.appendFileSync(path.join(this.downloadDir!, '.song_ids'), `${id}\t${(new Date()).toLocaleString('sv')}\t${name}\t${file}`); data = this.#parseFilename(file); } if (!data) - throw new Error('Failed to find file reference'); + return reject(new Error('Failed to find file reference')); const { fileName, artist, song, album, ext } = data; const filePath = path.join(this.downloadDir!, fileName);