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: