-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrorHandler.py
39 lines (27 loc) · 1.01 KB
/
ErrorHandler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Ben Ecsedy, Jack Krolik, Teng Li, Joey Scolponeti
DS3500
Homework 3
2/27/2023
"""
class ParserErrors(Exception):
""" Class for Parser Errors inherited from python exceptions class"""
pass
class FileNotFound(ParserErrors):
def __init__(self, filename):
""" For errors where the file is not found
Args:
filename (string): filename of the song
Returns (string): an error to the user
"""
super().__init__("The file " + "'" + str(filename) + "'" + " was not found, " \
"please ensure it is in your directory path")
class Index(ParserErrors):
""" For errors where the file is not found
Args:
filename (string): filename of the song
Returns (string): an error to the user
"""
def __init__(self, filename):
super().__init__("The parser is having trouble with the file " + "'" + str(filename) + "' " + \
"please ensure it is .lrc file when using the read_lrc parser")