Skip to content

Commit

Permalink
Also catch other exceptions while sales importing
Browse files Browse the repository at this point in the history
  • Loading branch information
JOJ0 committed Nov 20, 2024
1 parent 07a4d44 commit bab36ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions discodos/ctrl/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ def ls_releases(self, search_terms):
def import_sales_inventory(self):
"""Import sales inventory"""
start_time = time()
decode_errs = 0
decode_err = other_err = 0
self.cli.exit_if_offline(self.collection.ONLINE)
self.cli.p("Importing Discogs sales inventory into DiscoBASE...")
total_items = len(self.collection.me.inventory)
Expand Down Expand Up @@ -933,8 +933,12 @@ def import_sales_inventory(self):
except JSONDecodeError as e:
log.error("Catched a JSONDecodeError. Not retrying! %s", e)
decode_err += 1
except Exception as e:
log.error("Catched an Exception. Not retrying! %s", e)
other_err += 1

print(f"Discogs JSONDecode errors : {decode_errs}.")
print(f"Discogs JSONDecode errors : {decode_err}.")
print(f"Other errors : {other_err}.")
self.cli.duration_stats(start_time, 'Inventory import')

def tui_ls_releases(self, search_terms):
Expand Down

0 comments on commit bab36ac

Please sign in to comment.