From b330148b5f60b64a797409f0dfdf344a479cd822 Mon Sep 17 00:00:00 2001 From: Markus Kreusch Date: Fri, 15 Jan 2016 21:46:40 +0100 Subject: [PATCH] Avoid loosing exception stacktrace --- .../org/cryptomator/filesystem/crypto/CryptoWritableFile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/filesystem-crypto/src/main/java/org/cryptomator/filesystem/crypto/CryptoWritableFile.java b/main/filesystem-crypto/src/main/java/org/cryptomator/filesystem/crypto/CryptoWritableFile.java index c71eba542..a7dc30f40 100644 --- a/main/filesystem-crypto/src/main/java/org/cryptomator/filesystem/crypto/CryptoWritableFile.java +++ b/main/filesystem-crypto/src/main/java/org/cryptomator/filesystem/crypto/CryptoWritableFile.java @@ -8,6 +8,7 @@ *******************************************************************************/ package org.cryptomator.filesystem.crypto; +import java.io.IOException; import java.io.UncheckedIOException; import java.nio.ByteBuffer; import java.time.Instant; @@ -112,7 +113,7 @@ class CryptoWritableFile implements WritableFile { // TODO append padding } catch (ExecutionException e) { if (e.getCause() instanceof UncheckedIOException) { - throw (UncheckedIOException) e.getCause(); + throw new UncheckedIOException(new IOException(e)); } else { throw new IllegalStateException("Unexpected exception while waiting for encrypted file to be written", e); }