Merge pull request #666 from pyx/issue-665

Fix #665 - ImportError not preserved in __main__.py
This commit is contained in:
Raphael Deem 2017-04-27 00:32:09 -07:00 committed by GitHub
commit 75f5fa7c06

View File

@ -35,10 +35,10 @@ if __name__ == "__main__":
app.run(host=args.host, port=args.port, app.run(host=args.host, port=args.port,
workers=args.workers, debug=args.debug, ssl=ssl) workers=args.workers, debug=args.debug, ssl=ssl)
except ImportError: except ImportError as e:
log.error("No module named {} found.\n" log.error("No module named {} found.\n"
" Example File: project/sanic_server.py -> app\n" " Example File: project/sanic_server.py -> app\n"
" Example Module: project.sanic_server.app" " Example Module: project.sanic_server.app"
.format(module_name)) .format(e.name))
except ValueError as e: except ValueError as e:
log.error("{}".format(e)) log.error("{}".format(e))