|
From: Johan T. <jt...@us...> - 2006-10-25 08:41:45
|
Update of /cvsroot/vienti/vienti/source/se/biobanksregistersyd/vienti In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20793/source/se/biobanksregistersyd/vienti Modified Files: Vienti.java Log Message: Recurse through all chained exceptions when catching a GatheringException after calling generate(). This is ugly, but will have to do for now. Index: Vienti.java =================================================================== RCS file: /cvsroot/vienti/vienti/source/se/biobanksregistersyd/vienti/Vienti.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Vienti.java 20 Jun 2006 14:24:28 -0000 1.38 +++ Vienti.java 25 Oct 2006 08:41:39 -0000 1.39 @@ -24,6 +24,11 @@ ** liable for any use that may be made of the information contained herein. ** ** $Log$ + ** Revision 1.39 2006/10/25 08:41:39 jtorin + ** Recurse through all chained exceptions when catching a + ** GatheringException after calling generate(). This is ugly, but will have + ** to do for now. + ** ** Revision 1.38 2006/06/20 14:24:28 amijdema ** Removed the inline class CurrentClassGetter. Now they use CurrentContext.java ** in its place. @@ -337,7 +342,22 @@ logger.info("Datafile for token '" + df.getPropertyPrefix() + "' generated."); } catch (GatheringException e) { - logger.error("Datafile not generated: " + e.getMessage()); + // TODO Rewrite handling of exceptions. + // Make the loop code genereral for all exceptions (create + // a super class for exceptions). This is ugly. /JT + Throwable tmpException = e; + String message = "", tmp = ""; + while (tmpException != null) { + tmp = tmpException.getMessage(); + if (tmp != null) { + if (message.length() > 0) { + message = message + " Details: "; + } + message = message + tmp; + } + tmpException = tmpException.getCause(); + } + logger.error("Datafile not generated: " + message); logger.debug("StackTrace: ", e); errorOccured = true; } catch (GenerationException e) { |