01 /*
02 * JapeException.java
03 *
04 * Copyright (c) 1995-2010, The University of Sheffield. See the file
05 * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06 *
07 * This file is part of GATE (see http://gate.ac.uk/), and is free
08 * software, licenced under the GNU Library General Public License,
09 * Version 2, June 1991 (in the distribution as file licence.html,
10 * and also available at http://gate.ac.uk/gate/licence.html).
11 *
12 * Hamish Cunningham, 23/02/2000
13 *
14 * $Id: JapeException.java 12006 2009-12-01 17:24:28Z thomas_heitz $
15 */
16
17 package gate.jape;
18
19 import gate.util.GateException;
20
21 /** Superclass of all JAPE exceptions. */
22 public class JapeException extends GateException {
23
24 /** Debug flag */
25 private static final boolean DEBUG = false;
26
27 public JapeException(Throwable cause) {
28 super(cause);
29 }
30
31 public JapeException(String message) {
32 super(message);
33 }
34
35 public JapeException(String message, Throwable cause) {
36 super(message, cause);
37 }
38
39 public JapeException() {
40 super();
41 }
42
43 /**
44 * The location of the error.
45 */
46 String location = null;
47
48 void setLocation(String location) {
49 this.location = location;
50 }
51
52 public String getMessage() {
53 if(location != null) {
54 return super.getMessage() + " (at " + location + ")";
55 }
56 else {
57 return super.getMessage();
58 }
59 }
60
61 } // class JapeException
|