Index: django/core/handlers/base.py
===================================================================
--- django/core/handlers/base.py	(revision 13959)
+++ django/core/handlers/base.py	(working copy)
@@ -90,13 +90,13 @@
                 callback, callback_args, callback_kwargs = resolver.resolve(
                         request.path_info)
 
-                # Apply view middleware
-                for middleware_method in self._view_middleware:
-                    response = middleware_method(request, callback, callback_args, callback_kwargs)
-                    if response:
-                        return response
+                try:
+                    # Apply view middleware
+                    for middleware_method in self._view_middleware:
+                        response = middleware_method(request, callback, callback_args, callback_kwargs)
+                        if response:
+                            return response
 
-                try:
                     response = callback(request, *callback_args, **callback_kwargs)
                 except Exception, e:
                     # If the view raised an exception, run it through exception
Index: tests/regressiontests/base_handler/__init__.py
===================================================================
Index: tests/regressiontests/base_handler/middleware.py
===================================================================
--- tests/regressiontests/base_handler/middleware.py	(revision 0)
+++ tests/regressiontests/base_handler/middleware.py	(revision 0)
@@ -0,0 +1,48 @@
+"""
+Middleware to help test django.core.handlers.base.BaseHandler
+"""
+from django.http import HttpResponse
+
+class ProcessExceptionException(Exception):
+	pass
+
+class ProcessRequestException(Exception):
+	pass
+
+class ProcessResponseException(Exception):
+	pass
+
+class ProcessViewException(Exception):
+	pass
+
+class ProcessExceptionRaise:
+	def process_exception(self, request, exception):
+		raise ProcessExceptionException()
+
+class ProcessExceptionResponse:
+	def process_exception(self, request, exception):
+		return HttpResponse('OK')
+
+class ProcessResponseRaise:
+	def process_response(self, request, response):
+		raise ProcessResponseException()
+
+class ProcessResponseResponse:
+	def process_response(self, request, response):
+		return HttpResponse('OK')
+
+class ProcessRequestRaise:
+	def process_request(self, request):
+		raise ProcessRequestException()
+
+class ProcessRequestResponse:
+	def process_request(self, request):
+		return HttpResponse('OK')
+
+class ProcessViewRaise:
+	def process_view(self, request, view_func, *view_args, **view_kwargs):
+		raise ProcessViewException()
+
+class ProcessViewResponse:
+	def process_view(self, request, view_func, *view_args, **view_kwargs):
+		return HttpResponse('OK')
Index: tests/regressiontests/base_handler/models.py
===================================================================
Index: tests/regressiontests/base_handler/tests.py
===================================================================
--- tests/regressiontests/base_handler/tests.py	(revision 0)
+++ tests/regressiontests/base_handler/tests.py	(revision 0)
@@ -0,0 +1,85 @@
+"""
+Tests for django.core.handlers.base.BaseHandler
+"""
+from django.test import TestCase
+from django.conf import settings
+from django.core.handlers.base import BaseHandler
+from django.http import HttpRequest
+from middleware import *
+
+
+class BaseHandlerTestCase(TestCase):
+    
+    def setUp(self):
+        self.middleware_classes = settings.MIDDLEWARE_CLASSES
+        
+        # Tests want uncaught exceptions to fall through
+        self.debug_propagate_exceptions = settings.DEBUG_PROPAGATE_EXCEPTIONS
+        settings.DEBUG_PROPAGATE_EXCEPTIONS = True
+
+        self.handler = BaseHandler()
+        
+    def tearDown(self):
+    	# reset settings changes
+        settings.MIDDLEWARE_CLASSES = self.middleware_classes
+        settings.DEBUG_PROPAGATE_EXCEPTIONS = self.debug_propagate_exceptions
+
+    def _get_request(self):
+        request = HttpRequest()
+        request.META = {
+            'SERVER_NAME': 'testserver',
+            'SERVER_PORT': 80,
+        }
+        request.path = request.path_info = "/base_handler/path/"
+        return request
+
+    def test_request_raises_uncaught(self):
+    	"""
+    	Middleware.process_request exceptions are uncaught.
+    	"""
+        settings.MIDDLEWARE_CLASSES = (
+            'regressiontests.base_handler.middleware.ProcessRequestRaise',
+        )
+
+        self.handler.load_middleware()
+        
+        self.assertRaises(
+            ProcessRequestException,
+            self.handler.get_response,
+            self._get_request(),
+        )
+
+    def test_view_raises_uncaught(self):
+    	"""
+    	Middleware.process_view generated exception without any 
+    	process_exception handlers.
+    	"""
+        settings.MIDDLEWARE_CLASSES = (
+            'regressiontests.base_handler.middleware.ProcessViewRaise',
+        )
+        
+        self.handler.load_middleware()
+        
+        self.assertRaises(
+            ProcessViewException,
+            self.handler.get_response,
+            self._get_request(),
+        )
+
+    def test_view_raises_caught(self):
+    	"""
+    	Middleware.process_view generated exception with a process_exception
+    	handler providing a response.
+    	"""
+        settings.MIDDLEWARE_CLASSES = (
+            'regressiontests.base_handler.middleware.ProcessViewRaise',
+            'regressiontests.base_handler.middleware.ProcessExceptionResponse',
+        )
+        
+        self.handler.load_middleware()        
+        response = self.handler.get_response(self._get_request())
+
+		# Handled exception yields a valid response
+        self.assertEquals(response.status_code, 200)
+            
+        
Index: tests/regressiontests/base_handler/urls.py
===================================================================
--- tests/regressiontests/base_handler/urls.py	(revision 0)
+++ tests/regressiontests/base_handler/urls.py	(revision 0)
@@ -0,0 +1,6 @@
+from django.conf.urls.defaults import patterns
+import views
+
+urlpatterns = patterns('',
+    (r'^path/$', views.view),
+)
Index: tests/regressiontests/base_handler/views.py
===================================================================
--- tests/regressiontests/base_handler/views.py	(revision 0)
+++ tests/regressiontests/base_handler/views.py	(revision 0)
@@ -0,0 +1,4 @@
+from django.http import HttpResponse
+
+def view(request):
+	return HttpResponse('OK')
Index: tests/urls.py
===================================================================
--- tests/urls.py	(revision 13959)
+++ tests/urls.py	(working copy)
@@ -41,4 +41,7 @@
 
     # special headers views
     (r'special_headers/', include('regressiontests.special_headers.urls')),
+    
+    # base_handler views
+    (r'base_handler/', include('regressiontests.base_handler.urls')),
 )
