Refactor exceptions

* Suffix names for custom exceptions with "Error"
* Introduce exceptions for when the coressponding encoder isn't found
This commit is contained in:
Ritiek Malhotra
2020-03-17 03:09:56 +05:30
parent 083c430489
commit 29005f24ed
16 changed files with 276 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
import lyricwikia
from spotdl.lyrics.lyric_base import LyricBase
from spotdl.lyrics.exceptions import LyricsNotFound
from spotdl.lyrics.exceptions import LyricsNotFoundError
class LyricWikia(LyricBase):
@@ -13,6 +13,6 @@ class LyricWikia(LyricBase):
try:
lyrics = lyricwikia.get_lyrics(self.artist, self.song, linesep, timeout)
except lyricwikia.LyricsNotFound as e:
raise LyricsNotFound(e.args[0])
raise LyricsNotFoundError(e.args[0])
else:
return lyrics