Skip to content

Commit

Permalink
do not throw from a method that is called from a callback
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed May 2, 2024
1 parent d6ccfa8 commit c6f0fb6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.handler.ErrorHandler;
import org.eclipse.jetty.util.ExceptionUtil;
import org.eclipse.jetty.util.thread.AutoLock;
import org.eclipse.jetty.util.thread.Scheduler;
import org.slf4j.Logger;
Expand Down Expand Up @@ -1059,7 +1060,7 @@ protected void completed(Throwable failure)
LOG.debug("completed {}", toStringLocked());

if (_requestState != RequestState.COMPLETING)
throw new IllegalStateException(this.getStatusStringLocked());
failure = ExceptionUtil.combine(failure, new IllegalStateException(getStatusStringLocked()));

if (failure != null)
abortResponse(failure);
Expand Down

0 comments on commit c6f0fb6

Please sign in to comment.