From 20559e059dd037ae1efde85b207ac7556aec43e2 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 5 Oct 2019 14:44:05 -0400 Subject: [PATCH] Properly rethrow DataFormatException in Java 11+ compressor --- .../natives/compression/Java11VelocityCompressor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/native/src/main/java/com/velocitypowered/natives/compression/Java11VelocityCompressor.java b/native/src/main/java/com/velocitypowered/natives/compression/Java11VelocityCompressor.java index 034126bc8..999d12caa 100644 --- a/native/src/main/java/com/velocitypowered/natives/compression/Java11VelocityCompressor.java +++ b/native/src/main/java/com/velocitypowered/natives/compression/Java11VelocityCompressor.java @@ -80,6 +80,9 @@ public class Java11VelocityCompressor implements VelocityCompressor { inflater.reset(); } catch (Throwable e) { + if (e instanceof DataFormatException) { + throw (DataFormatException) e; + } throw new RuntimeException(e); } } @@ -111,6 +114,9 @@ public class Java11VelocityCompressor implements VelocityCompressor { deflater.reset(); } catch (Throwable e) { + if (e instanceof DataFormatException) { + throw (DataFormatException) e; + } throw new RuntimeException(e); } }