From 40dde737f4d86510d63f4835250ccd0226a94417 Mon Sep 17 00:00:00 2001 From: 0xDEAD10CC <0x@DEAD10.CC> Date: Sat, 29 Jul 2017 17:16:33 -0700 Subject: [PATCH] update --- src/Currency.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Currency.py b/src/Currency.py index 359ed65..c8a988d 100644 --- a/src/Currency.py +++ b/src/Currency.py @@ -35,13 +35,11 @@ class CurrencyTask(CoindroidAPITask): continue if self.currentTransaction: self.lastTransaction = self.currentTransaction.copy() - self.currentTransaction = request.json() - if not request.json(): - self.logger.error("Response is empty!") - elif len(request.json()) < 1: - self.logger.error("Response is empty!") - else: + try: self.currentTransaction = request.json()[0] + except: + self.logger.exception("Unable to get current transaction!") + continue self.logger.info("Retrieved currency from Coindroids...") self.logger.debug("{}".format(self.currentTransaction.get("last_ingested"))) if not self.lastTransaction: