]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Log RuntimeExceptions during rendering so that they are at least visible somewhere...
authorJeremias Maerki <jeremias@apache.org>
Mon, 3 Dec 2007 10:16:27 +0000 (10:16 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 3 Dec 2007 10:16:27 +0000 (10:16 +0000)
The original problem that led to this change was: "The number of this PDFNumber must not be empty" while producing a PDF/A with customized filter entries in the PDF configuration. The exception was a follow-up exception after a PDFConformanceException that was swallowed by a default ErrorListener.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@600467 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/RenderPagesModel.java
src/java/org/apache/fop/pdf/PDFObject.java

index 81ffac746be2dc06b8bc3dbd9f77a7878740a67a..a5257977a997baa370f13c5b40cb18bc2ad58760 100644 (file)
@@ -22,13 +22,11 @@ package org.apache.fop.area;
 // Java
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.List;
 import java.util.Iterator;
+import java.util.List;
 
-// XML
 import org.xml.sax.SAXException;
 
-// FOP
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.fonts.FontInfo;
@@ -119,6 +117,8 @@ public class RenderPagesModel extends AreaTreeModel {
             try {
                 renderer.renderPage(page);
             } catch (RuntimeException re) {
+                String err = "Error while rendering page " + page.getPageNumberString(); 
+                log.error(err, re);
                 throw re;
             } catch (Exception e) {
                 //TODO use error handler to handle this FOP or IO Exception or propagate exception
index 8152fcd8336aed443fabea027291026ca050fcd1..cab6b75f2a3c7478557a19c6813acb239ed93eee 100644 (file)
@@ -83,7 +83,9 @@ public abstract class PDFObject implements PDFWritable {
      */
     public void setObjectNumber(int objnum) {
         this.objnum = objnum;
-        log.trace("Assigning " + this + " object number " + objnum);
+        if (log.isTraceEnabled()) {
+            log.trace("Assigning " + this + " object number " + objnum);
+        }
     }
 
     /**