1 package org.andromda.core.repository;
2
3 /**
4 * An exception thrown whenever an error is encountered while performing RepositoryFacade processing.
5 *
6 * @author <A HREF="http://www.amowers.com">Anthony Mowers </A>
7 * @author Chad Brandon
8 * @author Bob Fields
9 */
10 public final class RepositoryFacadeException
11 extends RuntimeException
12 {
13 private static final long serialVersionUID = 34L;
14 /**
15 * Constructor for the RepositoryFacadeException object
16 *
17 * @param message describes cause of the exception
18 */
19 public RepositoryFacadeException(String message)
20 {
21 super(message);
22 }
23
24 /**
25 * Constructor for the RepositoryFacadeException object
26 *
27 * @param parent describes cause of the exception
28 */
29 public RepositoryFacadeException(final Throwable parent)
30 {
31 super(parent);
32 }
33
34 /**
35 * Constructor for the RepositoryFacadeException object
36 *
37 * @param message describes cause of the exception
38 * @param cause original exception that caused this exception
39 */
40 public RepositoryFacadeException(
41 String message,
42 Throwable cause)
43 {
44 super(message,
45 getRootCause(cause));
46 }
47
48 private static Throwable getRootCause(final Throwable throwable)
49 {
50 Throwable cause = throwable;
51 if (cause.getCause() != null)
52 {
53 cause = cause.getCause();
54 cause = getRootCause(cause);
55 }
56 return cause;
57 }
58 }