diff --git a/api/commands.py b/api/commands.py index c4f2c9edbb..93855bc3b8 100644 --- a/api/commands.py +++ b/api/commands.py @@ -739,8 +739,10 @@ def upgrade_db(): click.echo(click.style("Database migration successful!", fg="green")) - except Exception: + except Exception as e: logger.exception("Failed to execute database migration") + click.echo(click.style(f"Database migration failed: {e}", fg="red")) + raise SystemExit(1) finally: lock.release() else: