mirror of
https://github.com/yawaflua/Py-SPW.git
synced 2026-02-04 10:24:13 +02:00
Add more pre-checkers, docstrings
- add SpwCardNotFound error to `send_transaction()` - Add balance checker to `send_transactions()` - Made working docstrings - Correction errors in Parameters
This commit is contained in:
@@ -35,6 +35,11 @@ class SpwInsufficientFunds(SpwApiError):
|
||||
super().__init__("Insufficient funds on the card")
|
||||
|
||||
|
||||
class SpwCardNotFound(SpwApiError):
|
||||
def __init__(self):
|
||||
super().__init__("Receiver card not found")
|
||||
|
||||
|
||||
class MojangApiError(_ApiError):
|
||||
pass
|
||||
|
||||
@@ -51,3 +56,23 @@ class MojangAccountNotFound(MojangApiError):
|
||||
|
||||
class SurgeplayApiError(_ApiError):
|
||||
pass
|
||||
|
||||
|
||||
class LengthError(ValueError):
|
||||
def __init__(self, max_length: int):
|
||||
super().__init__(f"length must be <= {max_length}.")
|
||||
|
||||
|
||||
class BigAmountError(ValueError):
|
||||
def __init__(self):
|
||||
super().__init__(f"amount must be <= 1728.")
|
||||
|
||||
|
||||
class IsNotURLError(ValueError):
|
||||
def __init__(self):
|
||||
super().__init__(f"is not url.")
|
||||
|
||||
|
||||
class IsNotCardError(ValueError):
|
||||
def __init__(self, card: str):
|
||||
super().__init__(f"Receiver card (`{card}`) number not valid")
|
||||
|
||||
Reference in New Issue
Block a user