-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexceptions.py
35 lines (25 loc) · 978 Bytes
/
exceptions.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
class ParseLineError(Exception):
def __init__(self, line):
self.line = line
super(ParseLineError, self).__init__()
def __str__(self):
return f"Line unable to be parsed: {self.line}"
class ParseInputNumberError(Exception):
def __init__(self, line):
self.line = line
super(ParseInputNumberError, self).__init__()
def __str__(self):
return f"Invalid number of inputs: {self.line}"
class ParseNoGateError(Exception):
def __init__(self, name):
self.name = name
super(ParseNoGateError, self).__init__()
def __str__(self):
return f"Output created, but no corresponding logic gate: {self.name}"
class ParseInputNotFoundError(Exception):
def __init__(self, line, name):
self.line = line
self.name = name
super(ParseInputNotFoundError, self).__init__()
def __str__(self):
return f"Cannot find corresponding node {self.name} from {self.line}"