View Javadoc

1   package org.apache.maven;
2   
3   /* ====================================================================
4    *   Licensed to the Apache Software Foundation (ASF) under one or more
5    *   contributor license agreements.  See the NOTICE file distributed with
6    *   this work for additional information regarding copyright ownership.
7    *   The ASF licenses this file to You under the Apache License, Version 2.0
8    *   (the "License"); you may not use this file except in compliance with
9    *   the License.  You may obtain a copy of the License at
10   *
11   *       http://www.apache.org/licenses/LICENSE-2.0
12   *
13   *   Unless required by applicable law or agreed to in writing, software
14   *   distributed under the License is distributed on an "AS IS" BASIS,
15   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   *   See the License for the specific language governing permissions and
17   *   limitations under the License.
18   * ====================================================================
19   */
20  
21  /**
22   * The base class for all exceptions thrown by MavenSession.
23   *
24   * @version $Id: MavenException.java 517014 2007-03-11 21:15:50Z ltheussl $
25   */
26  public class MavenException
27      extends Exception
28  {
29  
30      /**
31       * Generated serial version ID
32       */
33      private static final long serialVersionUID = 5162719944310719528L;
34  
35      /**
36       * Creates a new instance of <code>MavenException</code> without detail
37       * message.
38       */
39      public MavenException()
40      {
41          super();
42      }
43  
44      /**
45       * Constructs an instance of <code>MavenException</code> with the specified
46       * detail message.
47       *
48       * @param msg the detail message.
49       */
50      public MavenException( String msg )
51      {
52          super( msg );
53      }
54  
55      /**
56       * Constructs an exception with the given message and exception as
57       * a root cause.
58       *
59       * @param message A description of or information about the exception.
60       *            Should not be <code>null</code> unless a cause is specified.
61       * @param cause The exception that might have caused this one.
62       *              May be <code>null</code>.
63       */
64      public MavenException( String message, Throwable cause )
65      {
66          super( message, cause );
67      }
68  
69      /**
70       * Constructs an exception with the given exception as a root cause.
71       *
72       * @param cause The exception that might have caused this one.
73       *              Should not be <code>null</code>.
74       */
75      public MavenException( Throwable cause )
76      {
77          super( cause );
78      }
79  
80      /**
81       * Returns the nested exception, if any.
82       *
83       * @return the nested exception, or <code>null</code> if no
84       *         exception is associated with this one
85       */
86      public Throwable getException()
87      {
88          return getCause();
89      }
90  }