forked from LBRYCommunity/lbry-sdk
Merge branch 'stopexceptions' into development
This commit is contained in:
commit
6c733f84e9
2 changed files with 6 additions and 3 deletions
|
@ -294,7 +294,7 @@ class LBRYWallet(object):
|
||||||
value = result['value']
|
value = result['value']
|
||||||
try:
|
try:
|
||||||
value_dict = json.loads(value)
|
value_dict = json.loads(value)
|
||||||
except ValueError:
|
except (ValueError, TypeError):
|
||||||
return Failure(InvalidStreamInfoError(name))
|
return Failure(InvalidStreamInfoError(name))
|
||||||
known_fields = ['stream_hash', 'name', 'description', 'key_fee', 'key_fee_address', 'thumbnail',
|
known_fields = ['stream_hash', 'name', 'description', 'key_fee', 'key_fee_address', 'thumbnail',
|
||||||
'content_license']
|
'content_license']
|
||||||
|
@ -395,7 +395,7 @@ class LBRYWallet(object):
|
||||||
if 'name' in claim and str(claim['name']) == name and 'value' in claim:
|
if 'name' in claim and str(claim['name']) == name and 'value' in claim:
|
||||||
try:
|
try:
|
||||||
value_dict = json.loads(claim['value'])
|
value_dict = json.loads(claim['value'])
|
||||||
except ValueError:
|
except (ValueError, TypeError):
|
||||||
return None
|
return None
|
||||||
if 'stream_hash' in value_dict and str(value_dict['stream_hash']) == sd_hash:
|
if 'stream_hash' in value_dict and str(value_dict['stream_hash']) == sd_hash:
|
||||||
if 'is controlling' in claim and claim['is controlling']:
|
if 'is controlling' in claim and claim['is controlling']:
|
||||||
|
|
|
@ -99,7 +99,10 @@ class Bencode(Encoding):
|
||||||
"""
|
"""
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
raise DecodeError, 'Cannot decode empty string'
|
raise DecodeError, 'Cannot decode empty string'
|
||||||
return self._decodeRecursive(data)[0]
|
try:
|
||||||
|
return self._decodeRecursive(data)[0]
|
||||||
|
except ValueError as e:
|
||||||
|
raise DecodeError, e.message
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _decodeRecursive(data, startIndex=0):
|
def _decodeRecursive(data, startIndex=0):
|
||||||
|
|
Loading…
Reference in a new issue