Author: lehmi
Date: Fri Jan  6 07:10:14 2012
New Revision: 1227993

URL: http://svn.apache.org/viewvc?rev=1227993&view=rev
Log:
PDFBOX-847: re-throw exception instead of swallowing it as proposed by Andreas 
Wollschlaeger

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java?rev=1227993&r1=1227992&r2=1227993&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java 
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/FlateFilter.java 
Fri Jan  6 07:10:14 2012
@@ -120,17 +120,23 @@ public class FlateFilter implements Filt
                     catch (OutOfMemoryError exception)
                     {
                         // if the stream is corrupt an OutOfMemoryError may 
occur
-                        LOG.error("Stop reading corrupt stream");
+                        LOG.error("FlateFilter: stop reading corrupt stream 
due to an OutOfMemoryError");
+                        // re-throw the exception, caller has to handle it
+                        throw exception;
                     }
                     catch (ZipException exception)
                     {
-                        // if the stream is corrupt an OutOfMemoryError may 
occur
-                        LOG.error("Stop reading corrupt stream");
+                        // if the stream is corrupt an ZipException may occur
+                        LOG.error("FlateFilter: stop reading corrupt stream 
due to a ZipException");
+                        // re-throw the exception, caller has to handle it
+                        throw exception;
                     }
                     catch (EOFException exception)
                     {
-                        // if the stream is corrupt an OutOfMemoryError may 
occur
-                        LOG.error("Stop reading corrupt stream");
+                        // if the stream is corrupt an EOFException may occur
+                        LOG.error("FlateFilter: stop reading corrupt stream 
due to an EOFException");
+                        // re-throw the exception, caller has to handle it
+                        throw exception;
                     }
                 }
                 else


Reply via email to