-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebased with master and updated everything to be CBPRO instead of GDA…
…X. Updated to check errors in send_message instead of _get
- Loading branch information
Showing
9 changed files
with
119 additions
and
433 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
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,81 @@ | ||
class CbproException(Exception): | ||
""" | ||
Base Coinbase Pro Exception | ||
Raised when Bad Response returned from Coinbase Pro | ||
See: https://docs.pro.coinbase.com/?r=1#errors | ||
""" | ||
|
||
def __init__(self, message, code): | ||
""" | ||
:param message: Message from Coinbase Pro response | ||
:type message: str | ||
:param code: HTTP Code | ||
:type code: int | ||
""" | ||
self._message = message | ||
self._code = code | ||
|
||
@property | ||
def message(self): | ||
return self._message | ||
|
||
@message.setter | ||
def message(self, message): | ||
self._message = message | ||
|
||
@property | ||
def code(self): | ||
return self._code | ||
|
||
@message.setter | ||
def code(self, code): | ||
self._code = code | ||
|
||
|
||
class InvalidCbproRequest(CbproException): | ||
""" | ||
Raised on 400 response from Coinbase Pro | ||
""" | ||
pass | ||
|
||
|
||
class UnauthorizedCbproRequest(CbproException): | ||
""" | ||
Raised on 401 response from Coinbase Pro | ||
""" | ||
pass | ||
|
||
|
||
class ForbiddenCbproRequest(CbproException): | ||
""" | ||
Raised on 403 response from Coinbase Pro | ||
""" | ||
pass | ||
|
||
|
||
class NotFoundCbproRequest(CbproException): | ||
""" | ||
Raised on 404 response from Coinbase Pro | ||
""" | ||
pass | ||
|
||
|
||
class CbproRateLimitRequest(CbproException): | ||
""" | ||
Raised on 429 response from Coinbase Pro | ||
""" | ||
pass | ||
|
||
|
||
class UnknownCbproClientRequest(CbproException): | ||
""" | ||
Raised on 4XX responses not tracked | ||
""" | ||
pass | ||
|
||
|
||
class InternalErrorCbproRequest(CbproException): | ||
""" | ||
Raised on 500 response from Coinbase Pro | ||
""" | ||
pass |
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
Oops, something went wrong.