You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importnonexistent# assuming this is... non-existentfromsanicimportSanic, responseapp=Sanic(__name__)
@app.route('/')asyncdefindex(request):
returnresponse.html('<p>Hello</p>')
When we try to import something non-existent, exception ImportError will be thrown, line 38 of main.py does not preserve the exception, reporting preset message (what's provided on commandline) instead. This is what we will get:
python -m sanic main.app
No module named main found.
Example File: project/sanic_server.py -> app
Example Module: project.sanic_server.app
It is very hard to find the true cause if the import statement that failed is, let's say, buried three levels of modules deep, for example.
The text was updated successfully, but these errors were encountered:
Given
main.py
:When we try to import something non-existent, exception
ImportError
will be thrown,line 38 of main.py does not preserve the exception, reporting preset message (what's provided on commandline) instead. This is what we will get:
It is very hard to find the true cause if the import statement that failed is, let's say, buried three levels of modules deep, for example.
The text was updated successfully, but these errors were encountered: