Properly rethrow DataFormatException in Java 11+ compressor

This commit is contained in:
Andrew Steinborn
2019-10-05 14:44:05 -04:00
parent b18f65fe0a
commit 20559e059d

View File

@@ -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);
}
}