Skip to content

Commit 8000da6

Browse files
err handling
1 parent 1b8e351 commit 8000da6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spotify_downloader/console/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from spotipy import Spotify
33
from spotipy.oauth2 import SpotifyClientCredentials
44
from os import path
5-
from sys import argv
5+
from sys import argv,exit
66

77
from spotify_downloader.search.song import SongObject
88
from spotify_downloader.download.downloader import download
@@ -27,7 +27,12 @@ def console():
2727

2828
songobj = SongObject(sp, mode)
2929

30-
tracks = songobj.get_tracks(url)
30+
try:
31+
tracks = songobj.get_tracks(url)
32+
# every exception sir? EVERYONE
33+
except Exception:
34+
print('\nError 404: Not Found')
35+
exit(1)
3136

3237
failed = []
3338
max_retry = 3

0 commit comments

Comments
 (0)