2018-08-05 02:49:10 +05:30
|
|
|
class RPCError(Exception):
|
|
|
|
code = 0
|
|
|
|
|
|
|
|
|
2015-08-20 11:27:15 -04:00
|
|
|
class PriceDisagreementError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class DuplicateStreamHashError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-01-22 12:55:02 -05:00
|
|
|
class DownloadCancelledError(Exception):
|
2015-08-20 11:27:15 -04:00
|
|
|
pass
|
|
|
|
|
2017-09-27 17:23:41 -04:00
|
|
|
|
|
|
|
class DownloadSDTimeout(Exception):
|
|
|
|
def __init__(self, download):
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'Failed to download sd blob {download} within timeout')
|
2017-09-27 17:23:41 -04:00
|
|
|
self.download = download
|
|
|
|
|
|
|
|
|
2017-06-20 18:56:08 -04:00
|
|
|
class DownloadTimeoutError(Exception):
|
|
|
|
def __init__(self, download):
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'Failed to download {download} within timeout')
|
2017-06-20 18:56:08 -04:00
|
|
|
self.download = download
|
2015-08-20 11:27:15 -04:00
|
|
|
|
2017-09-27 17:23:41 -04:00
|
|
|
|
|
|
|
class DownloadDataTimeout(Exception):
|
|
|
|
def __init__(self, download):
|
2019-03-11 18:43:00 -04:00
|
|
|
super().__init__(f'Failed to download data blobs for sd hash {download} within timeout')
|
2017-09-27 17:23:41 -04:00
|
|
|
self.download = download
|
|
|
|
|
|
|
|
|
2015-08-20 11:27:15 -04:00
|
|
|
class RequestCanceledError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-07-07 16:37:35 -04:00
|
|
|
class NegativeFundsError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NullFundsError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-08-05 02:49:10 +05:30
|
|
|
class InsufficientFundsError(RPCError):
|
|
|
|
code = -310
|
2015-08-20 11:27:15 -04:00
|
|
|
|
|
|
|
|
2018-08-22 19:14:14 -04:00
|
|
|
class CurrencyConversionError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class FileOpenError(ValueError):
|
|
|
|
# this extends ValueError because it is replacing a ValueError in EncryptedFileDownloader
|
|
|
|
# and I don't know where it might get caught upstream
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class ResolveError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2015-08-20 11:27:15 -04:00
|
|
|
class ConnectionClosedBeforeResponseError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2016-07-25 22:46:04 -04:00
|
|
|
class KeyFeeAboveMaxAllowed(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-02-27 20:18:57 -05:00
|
|
|
class InvalidExchangeRateResponse(Exception):
|
|
|
|
def __init__(self, source, reason):
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'Failed to get exchange rate from {source}:{reason}')
|
2017-02-27 20:18:57 -05:00
|
|
|
self.source = source
|
|
|
|
self.reason = reason
|
|
|
|
|
|
|
|
|
2015-08-20 11:27:15 -04:00
|
|
|
class UnknownNameError(Exception):
|
|
|
|
def __init__(self, name):
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'Name {name} is unknown')
|
2015-08-20 11:27:15 -04:00
|
|
|
self.name = name
|
|
|
|
|
2015-09-01 17:49:26 -04:00
|
|
|
|
2017-06-09 13:39:55 -04:00
|
|
|
class UnknownClaimID(Exception):
|
|
|
|
def __init__(self, claim_id):
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'Claim {claim_id} is unknown')
|
2017-06-09 13:39:55 -04:00
|
|
|
self.claim_id = claim_id
|
|
|
|
|
|
|
|
|
|
|
|
class UnknownURI(Exception):
|
|
|
|
def __init__(self, uri):
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'URI {uri} cannot be resolved')
|
2017-06-09 13:39:55 -04:00
|
|
|
self.name = uri
|
|
|
|
|
2018-08-05 02:49:10 +05:30
|
|
|
|
2017-07-17 11:55:24 -04:00
|
|
|
class UnknownOutpoint(Exception):
|
|
|
|
def __init__(self, outpoint):
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'Outpoint {outpoint} cannot be resolved')
|
2017-07-17 11:55:24 -04:00
|
|
|
self.outpoint = outpoint
|
2017-06-09 13:39:55 -04:00
|
|
|
|
2018-08-05 02:49:10 +05:30
|
|
|
|
2016-11-30 09:41:01 -06:00
|
|
|
class InvalidName(Exception):
|
|
|
|
def __init__(self, name, invalid_characters):
|
2016-07-28 18:48:29 -04:00
|
|
|
self.name = name
|
2016-11-30 09:41:01 -06:00
|
|
|
self.invalid_characters = invalid_characters
|
2018-07-21 18:34:59 -04:00
|
|
|
super().__init__(
|
|
|
|
'URI contains invalid characters: {}'.format(','.join(invalid_characters)))
|
2016-07-28 18:48:29 -04:00
|
|
|
|
|
|
|
|
2015-09-01 17:49:26 -04:00
|
|
|
class UnknownStreamTypeError(Exception):
|
|
|
|
def __init__(self, stream_type):
|
|
|
|
self.stream_type = stream_type
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return repr(self.stream_type)
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidStreamDescriptorError(Exception):
|
|
|
|
pass
|
|
|
|
|
2015-08-20 11:27:15 -04:00
|
|
|
|
|
|
|
class InvalidStreamInfoError(Exception):
|
2016-10-31 13:53:45 -04:00
|
|
|
def __init__(self, name, stream_info):
|
2018-10-18 13:42:45 +03:00
|
|
|
msg = f'{name} has claim with invalid stream info: {stream_info}'
|
2018-07-21 18:34:59 -04:00
|
|
|
super().__init__(msg)
|
2015-08-20 11:27:15 -04:00
|
|
|
self.name = name
|
2016-10-31 13:53:45 -04:00
|
|
|
self.stream_info = stream_info
|
2015-08-20 11:27:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
class MisbehavingPeerError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidDataError(MisbehavingPeerError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NoResponseError(MisbehavingPeerError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidResponseError(MisbehavingPeerError):
|
2015-09-04 16:22:02 -04:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NoSuchBlobError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-02-15 23:39:17 -05:00
|
|
|
class NoSuchStreamHash(Exception):
|
2015-09-16 16:27:46 -04:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-02-16 09:09:21 -05:00
|
|
|
class NoSuchSDHash(Exception):
|
|
|
|
"""
|
|
|
|
Raised if sd hash is not known
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2015-09-16 16:27:46 -04:00
|
|
|
class InvalidBlobHashError(Exception):
|
2016-09-20 16:58:30 -04:00
|
|
|
pass
|
|
|
|
|
2016-09-27 13:52:44 -04:00
|
|
|
|
2016-09-20 16:58:30 -04:00
|
|
|
class InvalidHeaderError(Exception):
|
|
|
|
pass
|
|
|
|
|
2016-10-14 18:25:37 -04:00
|
|
|
|
2016-09-20 16:58:30 -04:00
|
|
|
class InvalidAuthenticationToken(Exception):
|
2016-09-21 21:36:06 -04:00
|
|
|
pass
|
|
|
|
|
2016-10-14 18:25:37 -04:00
|
|
|
|
2016-09-27 13:52:44 -04:00
|
|
|
class NegotiationError(Exception):
|
2016-10-14 18:25:37 -04:00
|
|
|
pass
|
2017-07-20 03:45:07 +05:30
|
|
|
|
2018-07-24 12:03:43 -04:00
|
|
|
|
2017-07-20 03:45:07 +05:30
|
|
|
class InvalidCurrencyError(Exception):
|
|
|
|
def __init__(self, currency):
|
|
|
|
self.currency = currency
|
2018-07-21 18:34:59 -04:00
|
|
|
super().__init__(
|
2018-10-18 13:42:45 +03:00
|
|
|
f'Invalid currency: {currency} is not a supported currency.')
|
2018-02-09 11:29:37 -05:00
|
|
|
|
2018-07-24 12:03:43 -04:00
|
|
|
|
2018-02-09 11:29:37 -05:00
|
|
|
class NoSuchDirectoryError(Exception):
|
|
|
|
def __init__(self, directory):
|
|
|
|
self.directory = directory
|
2018-10-18 13:42:45 +03:00
|
|
|
super().__init__(f'No such directory {directory}')
|
2018-07-24 12:03:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
class ComponentStartConditionNotMet(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class ComponentsNotStarted(Exception):
|
|
|
|
pass
|