More details in messages by traversing exception chain.
authorErik Brakkee <erik@brakkee.org>
Fri, 31 Mar 2006 09:14:31 +0000 (09:14 +0000)
committerErik Brakkee <erik@brakkee.org>
Fri, 31 Mar 2006 09:14:31 +0000 (09:14 +0000)
crawler/basic/src/org/wamblee/crawler/AbstractPageRequest.java
crawler/basic/src/org/wamblee/crawler/GetPageRequest.java
crawler/basic/src/org/wamblee/crawler/PostPageRequest.java
crawler/kiss/src/org/wamblee/crawler/kiss/main/Report.java

index 432ebb4ac4f72010f30bd5371a15cce2d48e4f42..7607f764b3c20999842d14089e22cc52ee61ee40 100644 (file)
@@ -168,7 +168,7 @@ public abstract class AbstractPageRequest implements PageRequest {
             LOG.debug("Transformed result is \n" + os.toString());
             return transformed;
         } catch (TransformerConfigurationException e) {
-            throw new RuntimeException(e.getMessage(), e);
+            throw new TransformerException("Transformer configuration problem", e);
         } finally {
             // Release the connection.
             aMethod.releaseConnection();
index 9bc25608e66dd604cd1860803a2d9305e0d217fb..ac1f93018e70e64b770afb1bc273f48efc752808 100644 (file)
@@ -63,9 +63,9 @@ public class GetPageRequest extends AbstractPageRequest {
         try {
             return executeMethod(aClient, method);
         } catch (TransformerException e) {
-            throw new PageException(e.getMessage(), e);
+            throw new PageException("Transformation problem for url " + aUrl, e);
         } catch (IOException e) { 
-            throw new PageException(e.getMessage(), e);
+            throw new PageException("Problem getting " + aUrl, e);
         }
     }
 
index 598afe05115a6231cc4557a74e7cfa5cd02a4d48..a090627f0cebdb51c3cd7e3e80c97a5392b38c90 100644 (file)
@@ -55,9 +55,9 @@ public class PostPageRequest extends AbstractPageRequest {
         try {
             return executeMethod(aClient, method);
         } catch (TransformerException e) {
-            throw new PageException(e.getMessage(), e);
+            throw new PageException("Transformation problem for url " + aUrl, e);
         } catch (IOException e) { 
-            throw new PageException(e.getMessage(), e);
+            throw new PageException("Problem getting page " + aUrl, e);
         }
     }
 
index ab2e3a1cb219ce737abc2b4b1c2c6025a0af3c1d..8401477365decdf980bceb4795c2af6e49e4074f 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * 
  * Copyright 2005 the original author or authors.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -89,7 +90,11 @@ public class Report {
      * @param aException Exception that caused the problem.
      */
     public void addMessage(String aMessage, Exception aException) {
-        _messages.add(aMessage + ": " + aException.getMessage());
+        String msg = aMessage; 
+        for (Throwable e = aException; e != null; e = e.getCause()) {
+            msg += ": " + e.getMessage(); 
+        }
+        addMessage(msg);
     }
 
     /**