From 00d69db058f8ebcce45f50231205e72e6f4891f7 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Tue, 14 Sep 2010 09:16:19 +0000 Subject: [PATCH] LMS-1747 method getEndOfChain added SVN: 17821 --- .../systemsx/cisd/common/utilities/ExceptionUtils.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/ExceptionUtils.java b/common/source/java/ch/systemsx/cisd/common/utilities/ExceptionUtils.java index f99a5221de0..e9486a20e2a 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/ExceptionUtils.java +++ b/common/source/java/ch/systemsx/cisd/common/utilities/ExceptionUtils.java @@ -151,4 +151,13 @@ public final class ExceptionUtils } return null; } + + /** + * Returns the last {@link Throwable} of a chain of throwables. + */ + public static Throwable getEndOfChain(Throwable throwable) + { + Throwable cause = throwable.getCause(); + return cause == null ? throwable : getEndOfChain(cause); + } } \ No newline at end of file -- GitLab