Skip to content

Commit

Permalink
Use StaticException class for ContentProducer recycle and consumeAll
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Jun 10, 2022
1 parent 805c8ee commit d144c54
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -19,6 +19,7 @@

import org.eclipse.jetty.http.BadMessageException;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.util.StaticException;
import org.eclipse.jetty.util.component.Destroyable;
import org.eclipse.jetty.util.thread.AutoLock;
import org.slf4j.Logger;
Expand All @@ -31,8 +32,8 @@
class AsyncContentProducer implements ContentProducer
{
private static final Logger LOG = LoggerFactory.getLogger(AsyncContentProducer.class);
private static final HttpInput.ErrorContent RECYCLED_ERROR_CONTENT = new HttpInput.ErrorContent(new IllegalStateException("ContentProducer has been recycled"));
private static final Throwable UNCONSUMED_CONTENT_EXCEPTION = new IOException("Unconsumed content")
private static final HttpInput.ErrorContent RECYCLED_ERROR_CONTENT = new HttpInput.ErrorContent(new StaticException("ContentProducer has been recycled"));
private static final Throwable UNCONSUMED_CONTENT_EXCEPTION = new StaticException("Unconsumed content")
{
@Override
public Throwable fillInStackTrace()
Expand Down Expand Up @@ -190,7 +191,7 @@ public boolean consumeAll()
Throwable x = UNCONSUMED_CONTENT_EXCEPTION;
if (LOG.isDebugEnabled())
{
x = new IOException("Unconsumed content");
x = new StaticException("Unconsumed content");
LOG.debug("consumeAll {}", this, x);
}
failCurrentContent(x);
Expand Down

0 comments on commit d144c54

Please sign in to comment.