View Javadoc

1   package org.andromda.core.repository;
2   
3   
4   /***
5    * An exception thrown whenever an error is encountered while performing 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 RepositoryFacadeException object
15       *
16       * @param message describes cause of the exception
17       */
18      public RepositoryFacadeException(String message)
19      {
20          super(message);
21      }
22  
23      /***
24       * Constructor for the RepositoryFacadeException object
25       *
26       * @param message describes cause of the exception
27       */
28      public RepositoryFacadeException(final Throwable parent)
29      {
30          super(parent);
31      }
32  
33      /***
34       * Constructor for the RepositoryFacadeException object
35       *
36       * @param message describes cause of the exception
37       * @param cause original exception that caused this exception
38       */
39      public RepositoryFacadeException(
40          String message,
41          Throwable cause)
42      {
43          super(message,
44              getRootCause(cause));
45      }
46  
47      private static Throwable getRootCause(final Throwable throwable)
48      {
49          Throwable cause = throwable;
50          if (cause.getCause() != null)
51          {
52              cause = cause.getCause();
53              cause = getRootCause(cause);
54          }
55          return cause;
56      }
57  }