From: Tuukka Lehtonen Date: Wed, 11 Sep 2019 21:14:46 +0000 (+0300) Subject: Added logging for history archive import failure cases X-Git-Tag: v1.43.0~136^2~70^2~1 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=8b11164b8e84eb32dd87753fb90aadfcd73cee42;p=simantics%2Fplatform.git Added logging for history archive import failure cases gitlab #381 Change-Id: I7bf72f047a24932e3dbc4fd48781bad0f879a472 --- diff --git a/bundles/org.simantics.simulation/src/org/simantics/simulation/history/HistoryUtil.java b/bundles/org.simantics.simulation/src/org/simantics/simulation/history/HistoryUtil.java index 39c084cad..343adefc8 100644 --- a/bundles/org.simantics.simulation/src/org/simantics/simulation/history/HistoryUtil.java +++ b/bundles/org.simantics.simulation/src/org/simantics/simulation/history/HistoryUtil.java @@ -68,6 +68,8 @@ import org.simantics.simulation.Activator; import org.simantics.simulation.ontology.HistoryResource; import org.simantics.simulation.ontology.SimulationResource; import org.simantics.utils.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import gnu.trove.map.TObjectLongMap; import gnu.trove.map.hash.TObjectLongHashMap; @@ -80,6 +82,8 @@ import net.jpountz.lz4.LZ4BlockOutputStream; */ public class HistoryUtil { + private static final Logger LOGGER = LoggerFactory.getLogger(HistoryUtil.class); + private static final boolean DEBUG = false; private static final boolean PROFILE = true; @@ -663,6 +667,9 @@ public class HistoryUtil { try (RandomAccessBinary rab = new BinaryFile(path.toFile())) { importHistoryArchive(history, rab, result); return result; + } catch (IOException e) { + LOGGER.error("Failed to import history from archive {}", path); + throw e; } }