Issue #1242 Added a quiet exception

This commit is contained in:
Greg Wilkins 2017-01-12 09:25:54 +11:00
parent 20ac50480c
commit 1d0d601694
4 changed files with 35 additions and 3 deletions

View File

@ -27,7 +27,7 @@ import java.io.EOFException;
* the connection, vs and EOF thrown by some application talking to some other file/socket etc.
* The only difference in handling is that Jetty EOFs are logged less verbosely.
*/
public class EofException extends EOFException
public class EofException extends EOFException implements QuietException
{
public EofException()
{

View File

@ -0,0 +1,29 @@
//
// ========================================================================
// 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
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.io;
/* ------------------------------------------------------------ */
/** A Quiet Exception.
* <p> Exception classes that extend this interface will be logged
* less verbosely.
*/
public interface QuietException
{
}

View File

@ -39,6 +39,7 @@ import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.ChannelEndPoint;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.QuietException;
import org.eclipse.jetty.io.RuntimeIOException;
import org.eclipse.jetty.server.HttpChannelState.Action;
import org.eclipse.jetty.server.handler.ContextHandler;
@ -484,7 +485,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
if (failure instanceof RuntimeIOException)
failure = failure.getCause();
if (failure instanceof QuietServletException || !getServer().isRunning())
if (failure instanceof QuietException || !getServer().isRunning())
{
if (LOG.isDebugEnabled())
LOG.debug(_request.getRequestURI(), failure);

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.server;
import javax.servlet.ServletException;
import org.eclipse.jetty.io.QuietException;
/* ------------------------------------------------------------ */
/** A ServletException that is logged less verbosely than
@ -29,7 +31,7 @@ import javax.servlet.ServletException;
* than a stack trace.
* </p>
*/
public class QuietServletException extends ServletException
public class QuietServletException extends ServletException implements QuietException
{
public QuietServletException()
{