Allow IOError when saving CBZ
authorNiki Roo <niki@nikiroo.be>
Sun, 12 Aug 2018 20:35:33 +0000 (22:35 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 12 Aug 2018 20:35:33 +0000 (22:35 +0200)
src/be/nikiroo/fanfix/output/Text.java

index b45a51284bf913501bb0fa7fefd4c12a371c8bc8..4a45e5430fba9465b1e92a590bcae9cc18b28360 100644 (file)
@@ -105,8 +105,13 @@ class Text extends BasicOutput {
        protected void writeParagraphHeader(Paragraph para) throws IOException {
                if (para.getType() == ParagraphType.IMAGE) {
                        File file = new File(targetDir, getCurrentImageBestName(true));
-                       Instance.getCache().saveAsImage(para.getContentImage(), file,
-                                       nextParaIsCover);
+                       try {
+                               Instance.getCache().saveAsImage(para.getContentImage(), file,
+                                               nextParaIsCover);
+                       } catch (IOException e) {
+                               Instance.getTraceHandler().error(
+                                               new IOException("Cannot save an image", e));
+                       }
                }
 
                nextParaIsCover = false;