Useless error messages in management command execution
|Reported by:||Vasily Alexeev||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Right now BaseCommand.execute catches errors and outputs quite useless portions of them.
For example, I'm trying to move quite large (and, unfortunately, underdocumented) project from server to server. I know that I need to install a few components, but I do not precisely know which. So I just try running "runserver" command and fixing any errors occuring.
But soon an error like this appears:
Error: No module named exceptions
Ok, how can this error message help me to learn what's the problem? In my opinion, it can't.
But when I remove the try-catch from aforementioned method, I get a helpful traceback:
Traceback (most recent call last): File "manage.py", line 13, in <module> execute_manager(settings) [...] File "/[...]/utils.py", line 2, in <module> from sqlalchemy.exceptions import OperationalError ImportError: No module named exceptions
Oh, now I see that I obviously have problems with sqlalchemy installation. The source of the problem is pinned down and quickly fixed.
The question is: what's the reason of having this try-catch in the first place, if it serves only to turn a helpful traceback into a useless 1-line error message? In my opinion, it should be removed altogether.