This repository has been archived by the owner on Jun 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
eb62210
commit 666d357
Showing
1 changed file
with
38 additions
and
0 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,38 @@ | ||
"""This module holds exceptions to be used with Alpyca.""" | ||
|
||
|
||
class NumericError(Exception): | ||
"""Exception for when Alpaca throws an error with a numeric value. | ||
Args: | ||
ErrorNumber (int): Non-zero integer. | ||
ErrorMessage (str): Message describing the issue that was encountered. | ||
""" | ||
|
||
def __init__(self, ErrorNumber: int, ErrorMessage: str): | ||
"""Initialize NumericError object.""" | ||
super().__init__(self) | ||
self.message = "Error %d: %s" % (ErrorNumber, ErrorMessage) | ||
|
||
def __str__(self): | ||
"""Message to display with error.""" | ||
return self.message | ||
|
||
|
||
class ErrorMessage(Exception): | ||
"""Exception for when Alpaca throws an error without a numeric value. | ||
Args: | ||
Value (str): Message describing the issue that was encountered. | ||
""" | ||
|
||
def __init__(self, Value: str): | ||
"""Initialize ErrorMessage object.""" | ||
super().__init__(self) | ||
self.message = Value | ||
|
||
def __str__(self): | ||
"""Message to display with error.""" | ||
return self.message |