Skip to content

Commit

Permalink
Catch Exception
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos authored and senivam committed Dec 6, 2023
1 parent 23fe9ba commit 487cd39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -19,6 +19,7 @@
import java.io.Closeable;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.concurrent.BlockingDeque;
Expand Down Expand Up @@ -255,11 +256,11 @@ public Void call() throws IOException {
// if MBW replaced the stream, let's make sure to set it in the response context.
responseContext.setEntityStream(writtenStream);
}
} catch (final IOException ioe) {
} catch (final IOException | UncheckedIOException ioe) {
connectionCallback.onDisconnect(asyncContext);
throw ioe;
} catch (final MappableException mpe) {
if (mpe.getCause() instanceof IOException) {
if (mpe.getCause() instanceof IOException || mpe.getCause() instanceof UncheckedIOException) {
connectionCallback.onDisconnect(asyncContext);
}
throw mpe;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -139,7 +139,7 @@ public CompletionStage<?> send(OutboundSseEvent event) {
try {
this.write(event);
return CompletableFuture.completedFuture(null);
} catch (IOException e) {
} catch (Exception e) {
CompletableFuture<Void> future = new CompletableFuture<>();
future.completeExceptionally(e);
return future;
Expand Down

0 comments on commit 487cd39

Please sign in to comment.