Catch CancellationException while building chunks (#889)

Co-authored-by: Jason Mitchell <[email protected]>
This commit is contained in:
amyandJason Mitchell authored and GitHub committed 2025-03-08 20:45:10 -08:00
1 parent ad2b73edf9
commit d6d8a5dad6
1 file changed
+5 -2
@@ -31,6 +31,7 @@ import java.util.ArrayList;
import java.util.Deque;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -457,8 +458,10 @@ public class ChunkBuilder<T extends ChunkGraphicsState> {
this.task = task;
this.future = new CompletableFuture<>();
this.future.exceptionally(e -> {
LOGGER.info("Exception thrown while building chunk", e);
// e.printStackTrace();
if (!(e instanceof CancellationException)) {
LOGGER.info("Exception thrown while building chunk", e);
}
return null;
});
}