01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: */
19:
20: /*
21: *
22: * @author Nenad Vico
23: * @version 1.0.0 2003/03/09
24: *
25: */
26: package org.enhydra.dods;
27:
28: import org.enhydra.dods.exceptions.DodsBaseException;
29:
30: public class DODSException extends DodsBaseException {
31:
32: /**
33: * Construct a exception without a specified cause.
34: *
35: * @param msg The message associated with the exception.
36: */
37: public DODSException(String msg) {
38: super (msg);
39: }
40:
41: /**
42: * Construct a exception with a specified cause.
43: *
44: * @param cause The error or exception that cause this
45: * exception.
46: */
47: public DODSException(Throwable cause) {
48: super (cause);
49: }
50:
51: /**
52: * Construct a exception with an associated causing exception.
53: *
54: * @param msg The message associated with the exception.
55: * @param cause The error or exception that cause this
56: * exception.
57: */
58: public DODSException(String msg, Throwable cause) {
59: super (msg, cause);
60: }
61:
62: /**
63: * Creates a localized description of this Exception.
64: *
65: * @return the localized description of this Exception.
66: */
67: public String getLocalizedMessage() {
68: String message = getMessage();
69: int index = message.lastIndexOf(": ");
70:
71: if (index != -1) {
72: return message.substring(index + 1);
73: } else {
74: return getMessage();
75: }
76: }
77: }
|