Django

Code

Changeset 8990

Show
Ignore:
Timestamp:
09/08/08 21:18:06 (4 months ago)
Author:
adrian
Message:

Fixed #8978 -- We now print a helpful error message for 'manage.py dbshell' if the client executable is not found. Previously we were displaying a traceback

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management/commands/dbshell.py

    r8296 r8990  
    1 from django.core.management.base import NoArgsCommand 
     1from django.core.management.base import NoArgsCommand, CommandError 
    22 
    33class Command(NoArgsCommand): 
     
    88    def handle_noargs(self, **options): 
    99        from django.db import connection 
    10         connection.client.runshell() 
     10        try: 
     11            connection.client.runshell() 
     12        except OSError: 
     13            # Note that we're assuming OSError means that the client program 
     14            # isn't installed. There's a possibility OSError would be raised 
     15            # for some other reason, in which case this error message would be 
     16            # inaccurate. Still, this message catches the common case. 
     17            raise CommandError('You appear not to have the %r program installed or on your path.' % \ 
     18                connection.client.executable_name)