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