Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#17369 closed Bug (duplicate)

Useless error messages in management command execution

Reported by: Vasily Alexeev Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

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.

Change History (2)

comment:1 by Aymeric Augustin, 13 years ago

Resolution: duplicate
Status: newclosed

This appears to be a duplicate of #16397 and #11667.

comment:2 by Aymeric Augustin, 13 years ago

In [17197]:

Fixed #16397 -- Respected the --traceback flag in BaseCommand. This should make import loops easier to debug. Refs #11667, #17369.

Note: See TracTickets for help on using tickets.
Back to Top