diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index 161580eb4d..87c3dae202 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -63,7 +63,7 @@ public class SXSSFSheet implements Sheet, OoxmlSheetExtensions { setRandomAccessWindowSize(randomAccessWindowSize); try { _autoSizeColumnTracker = new AutoSizeColumnTracker(this); - } catch (InternalError e) { + } catch (Throwable t) { LOG.atWarn().log("Failed to create AutoSizeColumnTracker, possibly due to fonts not being installed in your OS", e); } } @@ -96,7 +96,7 @@ public class SXSSFSheet implements Sheet, OoxmlSheetExtensions { setRandomAccessWindowSize(_workbook.getRandomAccessWindowSize()); try { _autoSizeColumnTracker = new AutoSizeColumnTracker(this); - } catch (InternalError e) { + } catch (Throwable e) { LOG.atWarn().log("Failed to create AutoSizeColumnTracker, possibly due to fonts not being installed in your OS", e); } } diff --git a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java index 130169999c..d55e3634d5 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java +++ b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java @@ -300,12 +300,12 @@ public class SheetUtil { try { TextLayout layout = new TextLayout(str.getIterator(), fontRenderContext); return (int) layout.getAdvance(); - } catch (UnsatisfiedLinkError | NoClassDefFoundError | InternalError e) { + } catch (Throwable t) { if (ignoreMissingFontSystem) { return DEFAULT_CHAR_WIDTH; } - throw e; + throw t; } }