Author: Alex
Date: 2009-12-03 14:57:33 -0600 (Thu, 03 Dec 2009)
New Revision: 11792

Modified:
   django/branches/soc2009/multidb/django/db/utils.py
Log:
[soc2009/multidb] Corrected error handling when the database backend is 
incorrectly specified.  Patch from Russell Keith-Magee.

Modified: django/branches/soc2009/multidb/django/db/utils.py
===================================================================
--- django/branches/soc2009/multidb/django/db/utils.py  2009-12-03 15:11:14 UTC 
(rev 11791)
+++ django/branches/soc2009/multidb/django/db/utils.py  2009-12-03 20:57:33 UTC 
(rev 11792)
@@ -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):
@@ -29,7 +30,9 @@
                 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:

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to