diff --git a/lbry/lbry/error/README.md b/lbry/lbry/error/README.md index d20f02ddf..fc1ff9f87 100644 --- a/lbry/lbry/error/README.md +++ b/lbry/lbry/error/README.md @@ -49,13 +49,14 @@ Code | Name | Message | Comment 300 | TransactionRejected | Transaction rejected, unknown reason. 301 | TransactionFeeTooLow | Fee too low. 302 | TransactionInvalidSignature | Invalid signature. -**31x** | InsufficientFunds | Insufficient funds. | determined by wallet prior to attempting to broadcast a tx; this is different for example from a TX being created and sent but then rejected by lbrycrd for unspendable utxos. +**31x** | Balance | Errors related to your available balance. +311 | InsufficientFunds | Insufficient funds. | determined by wallet prior to attempting to broadcast a tx; this is different for example from a TX being created and sent but then rejected by lbrycrd for unspendable utxos. **32x** | ChannelSigning | Channel signing. 320 | ChannelKeyNotFound | Channel signing key not found. 321 | ChannelKeyInvalid | Channel signing key is out of date. | For example, channel was updated but you don't have the updated key. **33x** | GeneralResolve | Errors while resolving urls. -331 | Resolve | Failed to resolve '{uri}'. -332 | ResolveTimeout | Failed to resolve '{uri}' within the timeout. +331 | Resolve | Failed to resolve '{url}'. +332 | ResolveTimeout | Failed to resolve '{url}' within the timeout. **4xx** | Blob | **Blobs** **40x** | BlobAvailability | Blob availability. 400 | BlobNotFound | Blob not found. diff --git a/lbry/lbry/error/__init__.py b/lbry/lbry/error/__init__.py index 1ee0e2370..14c01a1e3 100644 --- a/lbry/lbry/error/__init__.py +++ b/lbry/lbry/error/__init__.py @@ -287,11 +287,19 @@ class TransactionInvalidSignatureError(TransactionRejectionError): super().__init__("Invalid signature.") -class InsufficientFundsError(BlockchainError): +class BalanceError(BlockchainError): + """ + Errors related to your available balance. + """ + + +class InsufficientFundsError(BalanceError): """ determined by wallet prior to attempting to broadcast a tx; this is different for example from a TX being created and sent but then rejected by lbrycrd for unspendable utxos. """ + def __init__(self): + super().__init__("Insufficient funds.") class ChannelSigningError(BlockchainError): @@ -320,13 +328,13 @@ class GeneralResolveError(BlockchainError): class ResolveError(GeneralResolveError): - def __init__(self, uri): - super().__init__(f"Failed to resolve '{uri}'.") + def __init__(self, url): + super().__init__(f"Failed to resolve '{url}'.") class ResolveTimeoutError(GeneralResolveError): - def __init__(self, uri): - super().__init__(f"Failed to resolve '{uri}' within the timeout.") + def __init__(self, url): + super().__init__(f"Failed to resolve '{url}' within the timeout.") class BlobError(BaseError): diff --git a/lbry/lbry/error/generate.py b/lbry/lbry/error/generate.py index 54ef4cf2b..29b8ea728 100644 --- a/lbry/lbry/error/generate.py +++ b/lbry/lbry/error/generate.py @@ -47,7 +47,7 @@ def main(): if len(args) > 1: fmt = "f" if comment: - comment = f'\n{INDENT}"""\n{INDENT}{comment}\n{INDENT}"""' + comment = f'\n{INDENT}"""\n{indent(fill(comment, 100), INDENT)}\n{INDENT}"""' print((CLASS+INIT).format( name=code, parent=parent, args=', '.join(args), desc=desc, doc=comment, format=fmt