This commit is contained in:
Jack Robison 2017-09-15 13:49:07 -04:00
parent 8419e1e1d5
commit adf89a9d1a
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
2 changed files with 6 additions and 4 deletions

View file

@ -469,7 +469,7 @@ class DownloadRequest(RequestHelper):
writer, d = blob.open_for_writing(self.peer)
if d is not None:
return BlobDownloadDetails(blob, d, writer.write, writer.close, self.peer)
log.debug('Skipping blob %s as there was an issue opening it for writing', blob)
log.warning('Skipping blob %s as there was an issue opening it for writing', blob)
return None
def _make_request(self, blob_details):

View file

@ -64,8 +64,7 @@ class MarketFeed(object):
self.rate = ExchangeRate(self.market, price, int(time.time()))
def _log_error(self, err):
log.warning(
"There was a problem updating %s exchange rate information from %s\n%s",
log.warning("There was a problem updating %s exchange rate information from %s\n%s",
self.market, self.name, err)
def _update_price(self):
@ -141,7 +140,10 @@ class LBRYioBTCFeed(MarketFeed):
)
def _handle_response(self, response):
json_response = json.loads(response)
try:
json_response = json.loads(response)
except ValueError:
raise InvalidExchangeRateResponse("invalid rate response : %s" % response)
if 'data' not in json_response:
raise InvalidExchangeRateResponse(self.name, 'result not found')
return defer.succeed(1.0 / json_response['data']['btc_usd'])