mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-14 01:49:56 +08:00
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 <cqi@redhat.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user