2018-08-04 23:19:10 +02:00
|
|
|
class RPCError(Exception):
|
|
|
|
code = 0
|
|
|
|
|
|
|
|
|
2015-08-20 17:27:15 +02:00
|
|
|
class PriceDisagreementError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class DuplicateStreamHashError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class DownloadCanceledError(Exception):
|
|
|
|
pass
|
|
|
|
|
2017-09-27 23:23:41 +02:00
|
|
|
|
|
|
|
class DownloadSDTimeout(Exception):
|
|
|
|
def __init__(self, download):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('Failed to download sd blob {} within timeout'.format(download))
|
2017-09-27 23:23:41 +02:00
|
|
|
self.download = download
|
|
|
|
|
|
|
|
|
2017-06-21 00:56:08 +02:00
|
|
|
class DownloadTimeoutError(Exception):
|
|
|
|
def __init__(self, download):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('Failed to download {} within timeout'.format(download))
|
2017-06-21 00:56:08 +02:00
|
|
|
self.download = download
|
2015-08-20 17:27:15 +02:00
|
|
|
|
2017-09-27 23:23:41 +02:00
|
|
|
|
|
|
|
class DownloadDataTimeout(Exception):
|
|
|
|
def __init__(self, download):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('Failed to download data blobs for sd hash '
|
2017-09-27 23:23:41 +02:00
|
|
|
'{} within timeout'.format(download))
|
|
|
|
self.download = download
|
|
|
|
|
|
|
|
|
2015-08-20 17:27:15 +02:00
|
|
|
class RequestCanceledError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-07-07 22:37:35 +02:00
|
|
|
class NegativeFundsError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NullFundsError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-08-04 23:19:10 +02:00
|
|
|
class InsufficientFundsError(RPCError):
|
|
|
|
code = -310
|
2015-08-20 17:27:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ConnectionClosedBeforeResponseError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2016-07-26 04:46:04 +02:00
|
|
|
class KeyFeeAboveMaxAllowed(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-02-28 02:18:57 +01:00
|
|
|
class InvalidExchangeRateResponse(Exception):
|
|
|
|
def __init__(self, source, reason):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('Failed to get exchange rate from {}:{}'.format(source, reason))
|
2017-02-28 02:18:57 +01:00
|
|
|
self.source = source
|
|
|
|
self.reason = reason
|
|
|
|
|
|
|
|
|
2015-08-20 17:27:15 +02:00
|
|
|
class UnknownNameError(Exception):
|
|
|
|
def __init__(self, name):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('Name {} is unknown'.format(name))
|
2015-08-20 17:27:15 +02:00
|
|
|
self.name = name
|
|
|
|
|
2015-09-01 23:49:26 +02:00
|
|
|
|
2017-06-09 19:39:55 +02:00
|
|
|
class UnknownClaimID(Exception):
|
|
|
|
def __init__(self, claim_id):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('Claim {} is unknown'.format(claim_id))
|
2017-06-09 19:39:55 +02:00
|
|
|
self.claim_id = claim_id
|
|
|
|
|
|
|
|
|
|
|
|
class UnknownURI(Exception):
|
|
|
|
def __init__(self, uri):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('URI {} cannot be resolved'.format(uri))
|
2017-06-09 19:39:55 +02:00
|
|
|
self.name = uri
|
|
|
|
|
2018-08-04 23:19:10 +02:00
|
|
|
|
2017-07-17 17:55:24 +02:00
|
|
|
class UnknownOutpoint(Exception):
|
|
|
|
def __init__(self, outpoint):
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('Outpoint {} cannot be resolved'.format(outpoint))
|
2017-07-17 17:55:24 +02:00
|
|
|
self.outpoint = outpoint
|
2017-06-09 19:39:55 +02:00
|
|
|
|
2018-08-04 23:19:10 +02:00
|
|
|
|
2016-11-30 16:41:01 +01:00
|
|
|
class InvalidName(Exception):
|
|
|
|
def __init__(self, name, invalid_characters):
|
2016-07-29 00:48:29 +02:00
|
|
|
self.name = name
|
2016-11-30 16:41:01 +01:00
|
|
|
self.invalid_characters = invalid_characters
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__(
|
|
|
|
'URI contains invalid characters: {}'.format(','.join(invalid_characters)))
|
2016-07-29 00:48:29 +02:00
|
|
|
|
|
|
|
|
2015-09-01 23:49:26 +02: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 17:27:15 +02:00
|
|
|
|
|
|
|
class InvalidStreamInfoError(Exception):
|
2016-10-31 18:53:45 +01:00
|
|
|
def __init__(self, name, stream_info):
|
2016-11-04 21:09:40 +01:00
|
|
|
msg = '{} has claim with invalid stream info: {}'.format(name, stream_info)
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__(msg)
|
2015-08-20 17:27:15 +02:00
|
|
|
self.name = name
|
2016-10-31 18:53:45 +01:00
|
|
|
self.stream_info = stream_info
|
2015-08-20 17:27:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
class MisbehavingPeerError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidDataError(MisbehavingPeerError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NoResponseError(MisbehavingPeerError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidResponseError(MisbehavingPeerError):
|
2015-09-04 22:22:02 +02:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NoSuchBlobError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-02-16 05:39:17 +01:00
|
|
|
class NoSuchStreamHash(Exception):
|
2015-09-16 22:27:46 +02:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-02-16 15:09:21 +01:00
|
|
|
class NoSuchSDHash(Exception):
|
|
|
|
"""
|
|
|
|
Raised if sd hash is not known
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2015-09-16 22:27:46 +02:00
|
|
|
class InvalidBlobHashError(Exception):
|
2016-09-20 22:58:30 +02:00
|
|
|
pass
|
|
|
|
|
2016-09-27 19:52:44 +02:00
|
|
|
|
2016-09-20 22:58:30 +02:00
|
|
|
class InvalidHeaderError(Exception):
|
|
|
|
pass
|
|
|
|
|
2016-10-15 00:25:37 +02:00
|
|
|
|
2016-09-20 22:58:30 +02:00
|
|
|
class InvalidAuthenticationToken(Exception):
|
2016-09-22 03:36:06 +02:00
|
|
|
pass
|
|
|
|
|
2016-10-15 00:25:37 +02:00
|
|
|
|
2016-09-27 19:52:44 +02:00
|
|
|
class NegotiationError(Exception):
|
2016-10-15 00:25:37 +02:00
|
|
|
pass
|
2017-07-20 00:15:07 +02:00
|
|
|
|
2018-07-24 18:03:43 +02:00
|
|
|
|
2017-07-20 00:15:07 +02:00
|
|
|
class InvalidCurrencyError(Exception):
|
|
|
|
def __init__(self, currency):
|
|
|
|
self.currency = currency
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__(
|
|
|
|
'Invalid currency: {} is not a supported currency.'.format(currency))
|
2018-02-09 17:29:37 +01:00
|
|
|
|
2018-07-24 18:03:43 +02:00
|
|
|
|
2018-02-09 17:29:37 +01:00
|
|
|
class NoSuchDirectoryError(Exception):
|
|
|
|
def __init__(self, directory):
|
|
|
|
self.directory = directory
|
2018-07-22 00:34:59 +02:00
|
|
|
super().__init__('No such directory {}'.format(directory))
|
2018-07-24 18:03:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ComponentStartConditionNotMet(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class ComponentsNotStarted(Exception):
|
|
|
|
pass
|