From 20d8c2b4e69318c332ea51186dc1c97cee350baf Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 2 May 2023 09:34:03 +1000 Subject: [PATCH] Include error type when an error occurs updating exchange rates (#4728) - Will allow us to further introspect errors received by sentry --- InvenTree/InvenTree/apps.py | 2 +- InvenTree/InvenTree/tasks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/InvenTree/apps.py b/InvenTree/InvenTree/apps.py index d40ea4eb29..c61ccba725 100644 --- a/InvenTree/InvenTree/apps.py +++ b/InvenTree/InvenTree/apps.py @@ -148,7 +148,7 @@ class InvenTreeConfig(AppConfig): try: update_exchange_rates() except Exception as e: - logger.error(f"Error updating exchange rates: {e}") + logger.error(f"Error updating exchange rates: {e} ({type(e)})") def add_user_on_startup(self): """Add a user on startup.""" diff --git a/InvenTree/InvenTree/tasks.py b/InvenTree/InvenTree/tasks.py index 27469f5270..a96523fdc3 100644 --- a/InvenTree/InvenTree/tasks.py +++ b/InvenTree/InvenTree/tasks.py @@ -530,7 +530,7 @@ def update_exchange_rates(): # Remove any exchange rates which are not in the provided currencies Rate.objects.filter(backend="InvenTreeExchange").exclude(currency__in=currency_codes()).delete() except Exception as e: # pragma: no cover - logger.error(f"Error updating exchange rates: {e}") + logger.error(f"Error updating exchange rates: {e} ({type(e)})") @scheduled_task(ScheduledTask.DAILY)