From 60bdadb9a3464a7f1f322655dc32d6a33d754be7 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 16 Jul 2005 22:12:24 +0000 Subject: [PATCH] Moved django.core.handler.ImproperlyConfigured into django.core.exceptions git-svn-id: http://code.djangoproject.com/svn/django/trunk@120 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/exceptions.py | 4 ++++ django/core/handler.py | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/django/core/exceptions.py b/django/core/exceptions.py index 68036f2d7f..9d1aab665f 100644 --- a/django/core/exceptions.py +++ b/django/core/exceptions.py @@ -24,3 +24,7 @@ class ViewDoesNotExist(Exception): class MiddlewareNotUsed(Exception): "This middleware is not used in this server configuration" pass + +class ImproperlyConfigured(Exception): + "Django is somehow improperly configured" + pass diff --git a/django/core/handler.py b/django/core/handler.py index 42f4c69d4c..4abc937aa6 100644 --- a/django/core/handler.py +++ b/django/core/handler.py @@ -5,9 +5,6 @@ from django.utils import httpwrappers # settings) until after CoreHandler has been called; otherwise os.environ # won't be set up correctly (with respect to settings). -class ImproperlyConfigured(Exception): - pass - class CoreHandler: def __init__(self): @@ -57,11 +54,11 @@ class CoreHandler: try: mod = __import__(mw_module, '', '', ['']) except ImportError, e: - raise ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e) + raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e) try: mw_class = getattr(mod, mw_classname) except AttributeError: - raise ImproperlyConfigured, 'Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname) + raise exceptions.ImproperlyConfigured, 'Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname) try: mw_instance = mw_class()