]> WPIA git - gigi.git/blobdiff - lib/jetty/org/eclipse/jetty/server/handler/RequestLogHandler.java
updating jetty to jetty-9.2.16.v2016040
[gigi.git] / lib / jetty / org / eclipse / jetty / server / handler / RequestLogHandler.java
index 706b988bffc4398688488cffe787781d461cdd32..00ec275c377400c7f2cb973edfe318b0f6eac766 100644 (file)
@@ -1,6 +1,6 @@
 //
 //  ========================================================================
-//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
+//  Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
 //  ------------------------------------------------------------------------
 //  All rights reserved. This program and the accompanying materials
 //  are made available under the terms of the Eclipse Public License v1.0
@@ -66,6 +66,9 @@ public class RequestLogHandler extends HandlerWrapper
         @Override
         public void onError(AsyncEvent event) throws IOException
         {
+            HttpServletResponse response = (HttpServletResponse)event.getAsyncContext().getResponse();
+            if (!response.isCommitted())
+                response.setStatus(500);
             
         }
         
@@ -91,6 +94,12 @@ public class RequestLogHandler extends HandlerWrapper
         {
             super.handle(target, baseRequest, request, response);
         }
+        catch(Error|IOException|ServletException|RuntimeException e)
+        {
+            if (!response.isCommitted() && !baseRequest.getHttpChannelState().isAsync())
+                response.setStatus(500);
+            throw e;
+        }
         finally
         {
             if (_requestLog != null && baseRequest.getDispatcherType().equals(DispatcherType.REQUEST))