From 829d427a76f95fe9d7ed87397d886917bf07564c Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 20 Nov 2023 13:14:16 +1100 Subject: [PATCH] Improve error handling when updating currency exchange (#5939) - Suppress output for expected error conditions --- InvenTree/InvenTree/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/tasks.py b/InvenTree/InvenTree/tasks.py index 6dbcb85bbf..efd0df90e8 100644 --- a/InvenTree/InvenTree/tasks.py +++ b/InvenTree/InvenTree/tasks.py @@ -553,7 +553,7 @@ def update_exchange_rates(force: bool = False): # Record successful task execution record_task_success('update_exchange_rates') - except OperationalError: + except (AppRegistryNotReady, OperationalError, ProgrammingError): logger.warning("Could not update exchange rates - database not ready") except Exception as e: # pragma: no cover logger.exception("Error updating exchange rates: %s", str(type(e)))