From 476c51e1f46b0febd895181061d11a2ede7782fd Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Wed, 31 Oct 2018 16:57:53 +0800 Subject: [PATCH] Log exception for catching custom exception in init handler For tracking error easily when custom exception is raised, log exception as well before transitioning to failed state. Signed-off-by: Chenxiong Qi --- module_build_service/scheduler/handlers/modules.py | 1 + 1 file changed, 1 insertion(+) diff --git a/module_build_service/scheduler/handlers/modules.py b/module_build_service/scheduler/handlers/modules.py index 28254db3..76edf335 100644 --- a/module_build_service/scheduler/handlers/modules.py +++ b/module_build_service/scheduler/handlers/modules.py @@ -157,6 +157,7 @@ def init(config, session, msg): build.transition(conf, models.BUILD_STATES["wait"]) # Catch custom exceptions that we can expose to the user except (UnprocessableEntity, Forbidden, ValidationError, RuntimeError) as e: + log.exception(str(e)) # Rollback changes underway session.rollback() build.transition(conf, models.BUILD_STATES["failed"], state_reason=str(e))