From f48506d620d8cdbb4c37af6a6c4cf81908af3ce9 Mon Sep 17 00:00:00 2001 From: Moshe Nahmias Date: Wed, 5 Jul 2023 14:38:15 +0300 Subject: [PATCH] fix #2757 - Improved error messaging on startup time application induced import error (#2770) Co-authored-by: Adam Hopkins --- sanic/cli/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sanic/cli/app.py b/sanic/cli/app.py index 07d02c7e..b8db98b9 100644 --- a/sanic/cli/app.py +++ b/sanic/cli/app.py @@ -180,6 +180,10 @@ Or, a path to a directory to run as a simple HTTP server: " Example File: project/sanic_server.py -> app\n" " Example Module: project.sanic_server.app" ) + error_logger.error( + "\nThe error below might have caused the above one:\n" + f"{e.msg}" + ) sys.exit(1) else: raise e