-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
122 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class Error(Exception): | ||
"""Base class for exceptions in this module.""" | ||
pass | ||
|
||
|
||
class NoReader(Error): | ||
"""Exception raised when no readers are plug to the computer. | ||
Attributes: | ||
message -- explanation of the error | ||
""" | ||
|
||
def __init__(self, message): | ||
self.message = message | ||
|
||
|
||
class NoCommunication(Error): | ||
"""Exception raised when the communication can't be established. | ||
Attributes: | ||
message -- explanation of the error | ||
""" | ||
|
||
def __init__(self, message): | ||
self.message = message | ||
|
||
|
||
class OptionOutOfRange(Error): | ||
"""Exception raised when you try to access an element not in the `option.options` dictionary | ||
Attributes: | ||
message -- explanation of the error | ||
""" | ||
|
||
def __init__(self, message): | ||
self.message = message | ||
|
||
|
||
class InstructionFailed(Error): | ||
"""Exception raised when the instruction failed | ||
Attributes: | ||
message -- explanation of the error | ||
""" | ||
|
||
def __init__(self, message): | ||
self.message = message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters