01: package org.andromda.core.repository;
02:
03: /**
04: * An exception thrown whenever an error is encountered while performing RepositoryFacade processing.
05: *
06: * @author <A HREF="http://www.amowers.com">Anthony Mowers </A>
07: * @author Chad Brandon
08: */
09: public final class RepositoryFacadeException extends RuntimeException {
10: /**
11: * Constructor for the RepositoryFacadeException object
12: *
13: * @param message describes cause of the exception
14: */
15: public RepositoryFacadeException(String message) {
16: super (message);
17: }
18:
19: /**
20: * Constructor for the RepositoryFacadeException object
21: *
22: * @param message describes cause of the exception
23: */
24: public RepositoryFacadeException(final Throwable parent) {
25: super (parent);
26: }
27:
28: /**
29: * Constructor for the RepositoryFacadeException object
30: *
31: * @param message describes cause of the exception
32: * @param cause original exception that caused this exception
33: */
34: public RepositoryFacadeException(String message, Throwable cause) {
35: super (message, getRootCause(cause));
36: }
37:
38: private static Throwable getRootCause(final Throwable throwable) {
39: Throwable cause = throwable;
40: if (cause.getCause() != null) {
41: cause = cause.getCause();
42: cause = getRootCause(cause);
43: }
44: return cause;
45: }
46: }
|