View Javadoc

1   /*
2    * @(#)AstroGridException.java   1.0
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
9    *
10   */
11  package org.astrogrid;
12  
13  import org.astrogrid.i18n.AstroGridMessage;
14  
15  /***
16   * Generic astrogrid exception
17   * @author unknown
18   *
19   */
20  public class AstroGridException extends Exception {
21    /***
22     * embedded message
23     */
24    private AstroGridMessage message = null;
25  
26    /***
27     * ctor
28     * @param message message to wrap
29     */
30    public AstroGridException(final AstroGridMessage message) {
31      this.message = message;
32    }
33  
34    /***
35     * ctor
36     * @param message to wrap
37     * @param throwable underlying exception
38     */
39    public AstroGridException(
40      final AstroGridMessage message,
41      final Throwable throwable) {
42      super(throwable);
43      this.message = message;
44    }
45  
46    /***
47     * ctor
48     * @param throwable underlying exception
49     */
50    public AstroGridException(final Throwable throwable) {
51      super(throwable);
52    }
53  
54    /***
55     * getter
56     * @return wrapped message
57     */
58    public final AstroGridMessage getAstroGridMessage() {
59      return message;
60    }
61  
62  }