FOP-2694: PDF plugin doesnt show which pdf failed

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop-pdf-images/trunk@1784726 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java b/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java
index 8cff264..cfcdd5b 100644
--- a/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java
+++ b/src/java/org/apache/fop/render/pdf/pdfbox/ImageConverterPDF2G2D.java
@@ -118,7 +118,7 @@
                 g2d.transform(at);
                 new PDFRenderer(pdDocument).renderPageToGraphics(selectedPage, g2d);
             } catch (Throwable t) {
-                throw new RuntimeException("Error while painting PDF page: " + uri, t);
+                throw new RuntimeException("Error while painting PDF page: " + uri + " " + t.getMessage(), t);
             }
         }
 
diff --git a/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java b/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java
index de7cd52..aa16a73 100644
--- a/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java
+++ b/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxImageHandler.java
@@ -80,7 +80,8 @@
             }
             generator.placeImage(pageAdjust, stream);
         } catch (Throwable t) {
-            throw new RuntimeException("Error on PDF page: " + pdfImage.getInfo().getOriginalURI(), t);
+            throw new RuntimeException(
+                    "Error on PDF page: " + pdfImage.getInfo().getOriginalURI() + " " + t.getMessage(), t);
         }
     }
 
diff --git a/test/java/org/apache/fop/render/pdf/PDFBoxAdapterTestCase.java b/test/java/org/apache/fop/render/pdf/PDFBoxAdapterTestCase.java
index 0d387e1..f5fd40d 100644
--- a/test/java/org/apache/fop/render/pdf/PDFBoxAdapterTestCase.java
+++ b/test/java/org/apache/fop/render/pdf/PDFBoxAdapterTestCase.java
@@ -445,7 +445,7 @@
         } catch (RuntimeException e) {
             msg = e.getMessage();
         }
-        Assert.assertEquals(msg, "Error while painting PDF page: " + ERROR);
+        Assert.assertTrue(msg.startsWith("Error while painting PDF page: " + ERROR));
     }
 
     @Test
@@ -458,6 +458,6 @@
         } catch (RuntimeException e) {
             msg = e.getMessage();
         }
-        Assert.assertEquals(msg, "Error on PDF page: " + ERROR);
+        Assert.assertTrue(msg.startsWith("Error on PDF page: " + ERROR));
     }
 }