Skip to content

Commit

Permalink
[soc2009/multidb] Corrected error handling when the database backend …
Browse files Browse the repository at this point in the history
…is incorrectly specified. Patch from Russell Keith-Magee.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11792 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
alex committed Dec 3, 2009
1 parent fdadb7b commit a824570
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/db/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os

from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module

def load_backend(backend_name):
Expand Down Expand Up @@ -29,7 +30,9 @@ def load_backend(backend_name):
available_backends = []
available_backends.sort()
if backend_name not in available_backends:
error_msg = "%r isn't an available database backend. Available options are: %s\nError was: %s" % \
error_msg = ("%r isn't an available database backend. \n" +
"Try using django.db.backends.XXX, where XXX is one of:\n %s\n" +
"Error was: %s") % \
(backend_name, ", ".join(map(repr, available_backends)), e_user)
raise ImproperlyConfigured(error_msg)
else:
Expand Down

0 comments on commit a824570

Please sign in to comment.