From 8f9de993d0ac6bc31fb7ea242e438b33ccd5ad9b Mon Sep 17 00:00:00 2001 From: leventov Date: Sun, 19 Feb 2017 20:19:33 -0600 Subject: [PATCH] Catch Throwable instead of Exception and convert to ChronicleHashRecoveryFailedException in ChronicleMapBuilder.openWithExistingFile() --- .../openhft/chronicle/map/ChronicleMapBuilder.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java index fb2de366b..d6b140943 100755 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java @@ -1717,11 +1717,12 @@ public final class ChronicleMapBuilder implements commitChronicleMapReady(map, raf, headerBuffer, headerSize); } return map; - } catch (Exception e) { - if (recover && !(e instanceof IOException) && - !(e instanceof ChronicleHashRecoveryFailedException)) - throw new ChronicleHashRecoveryFailedException(e); - throw Throwables.propagateNotWrapping(e, IOException.class); + } catch (Throwable t) { + if (recover && !(t instanceof IOException) && + !(t instanceof ChronicleHashRecoveryFailedException)) { + throw new ChronicleHashRecoveryFailedException(t); + } + throw Throwables.propagateNotWrapping(t, IOException.class); } }