From ade89ab795da446afddf981142023caa5cdfa6f2 Mon Sep 17 00:00:00 2001 From: Philip Xu Date: Wed, 26 Apr 2017 22:57:19 -0400 Subject: [PATCH 1/2] Fix #665 - ImportError not preserved in __main__.py --- sanic/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sanic/__main__.py b/sanic/__main__.py index b6a66b8e..7a5b9f92 100644 --- a/sanic/__main__.py +++ b/sanic/__main__.py @@ -35,10 +35,10 @@ if __name__ == "__main__": app.run(host=args.host, port=args.port, workers=args.workers, debug=args.debug, ssl=ssl) - except ImportError: - log.error("No module named {} found.\n" + except ImportError as e: + log.error("{} found.\n" " Example File: project/sanic_server.py -> app\n" " Example Module: project.sanic_server.app" - .format(module_name)) + .format(e)) except ValueError as e: log.error("{}".format(e)) From 9152a1a2661c8a84d421dd3d775138d479aebacf Mon Sep 17 00:00:00 2001 From: Philip Xu Date: Thu, 27 Apr 2017 03:16:38 -0400 Subject: [PATCH 2/2] Improved on wording --- sanic/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/__main__.py b/sanic/__main__.py index 7a5b9f92..cc580566 100644 --- a/sanic/__main__.py +++ b/sanic/__main__.py @@ -36,9 +36,9 @@ if __name__ == "__main__": app.run(host=args.host, port=args.port, workers=args.workers, debug=args.debug, ssl=ssl) except ImportError as e: - log.error("{} found.\n" + log.error("No module named {} found.\n" " Example File: project/sanic_server.py -> app\n" " Example Module: project.sanic_server.app" - .format(e)) + .format(e.name)) except ValueError as e: log.error("{}".format(e))