forked from areed1192/td-ameritrade-python-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/areed1192/td-ameritrade-p…
- Loading branch information
Showing
3 changed files
with
130 additions
and
6 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 |
---|---|---|
|
@@ -116,3 +116,4 @@ pypirc | |
*State.json | ||
tests/parse_level_two.py | ||
certs/ | ||
td/td_state.json |
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
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,107 @@ | ||
class TknExpError(Exception): | ||
"""Raise exception when refresh or access token is expired. | ||
Args: | ||
Exception (Exception): The base python exception class | ||
""" | ||
def __init__(self, message): | ||
"""Print out message for this exception. | ||
Args: | ||
message (str): Pass in the message returned by the server. | ||
""" | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
class ExdLmtError(Exception): | ||
"""Raise exception when exceeding query limit of the server. | ||
Args: | ||
Exception (Exception): The base python exception class | ||
""" | ||
def __init__(self, message): | ||
"""Print out message for this exception. | ||
Args: | ||
message (str): Pass in the message returned by the server. | ||
""" | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
class NotNulError(Exception): | ||
"""Raise exception when a null value is passed into non-null field. | ||
Args: | ||
Exception (Exception): The base python exception class | ||
""" | ||
def __init__(self, message): | ||
"""Print out message for this exception. | ||
Args: | ||
message (str): Pass in the message returned by the server. | ||
""" | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
class ForbidError(Exception): | ||
"""Raise forbidden exception. This usually occurs when the app does | ||
not have access to the account. | ||
Args: | ||
Exception (Exception): The base python exception class | ||
""" | ||
def __init__(self, message): | ||
"""Print out message for this exception. | ||
Args: | ||
message (str): Pass in the message returned by the server. | ||
""" | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
class NotFndError(Exception): | ||
"""Raise exception when criteria is not found. | ||
Args: | ||
Exception (Exception): The base python exception class | ||
""" | ||
def __init__(self, message): | ||
"""Print out message for this exception. | ||
Args: | ||
message (str): Pass in the message returned by the server. | ||
""" | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
class ServerError(Exception): | ||
"""Raise exception when there is an error with the service or the server | ||
cannot provide response. | ||
Args: | ||
Exception (Exception): The base python exception class | ||
""" | ||
def __init__(self, message): | ||
"""Print out message for this exception. | ||
Args: | ||
message (str): Pass in the message returned by the server. | ||
""" | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
class GeneralError(Exception): | ||
"""Raise exception for all other status code >400 errors which are not | ||
defined above. | ||
Args: | ||
Exception (Exception): The base python exception class | ||
""" | ||
def __init__(self, message): | ||
"""Print out message for this exception. | ||
Args: | ||
message (str): Pass in the message returned by the server. | ||
""" | ||
self.message = message | ||
super().__init__(self.message) |