View Javadoc
1   /* *****************************************************************************
2    * jArduino: Arduino C++ Code Generation From Java
3    * Copyright 2020 Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   ******************************************************************************/
17  package net.sourceforge.jarduino;
18  
19  /**
20   * Exception class.
21   */
22  public class ArduinoException
23          extends Exception {
24      /**
25       * The detail.
26       */
27      private final String theDetail;
28  
29      /**
30       * Constructor.
31       * @param pMessage the message
32       */
33      public ArduinoException(final String pMessage) {
34          super(pMessage);
35          theDetail = null;
36      }
37  
38      /**
39       * Constructor.
40       * @param pMessage the message
41       * @param e the exception
42       */
43      public ArduinoException(final String pMessage,
44                              final Throwable e) {
45          super(pMessage, e);
46          theDetail = null;
47      }
48  
49      /**
50       * Constructor.
51       * @param pMessage the message
52       * @param pDetail the detail
53       */
54      public ArduinoException(final String pMessage,
55                              final String pDetail) {
56          super(pMessage);
57          theDetail = pDetail;
58      }
59  
60      /**
61       * Obtain the detail.
62       * @return the detail
63       */
64      public String getDetail() {
65          return theDetail;
66      }
67  }