Include error type when an error occurs updating exchange rates (#4728)

- Will allow us to further introspect errors received by sentry
This commit is contained in:
Oliver 2023-05-02 09:34:03 +10:00 committed by GitHub
parent 6bd95f3b15
commit 20d8c2b4e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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."""

View File

@ -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)