01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.util;
20:
21: /**
22: * Interface supplying additional exception information. All OpenJPA
23: * exceptions implement this interface.
24: *
25: * @author Abe White
26: * @since 0.4.0
27: */
28: public interface ExceptionInfo {
29:
30: public static final int GENERAL = 0;
31: public static final int INTERNAL = 1;
32: public static final int STORE = 2;
33: public static final int UNSUPPORTED = 3;
34: public static final int USER = 4;
35:
36: /**
37: * Exception message.
38: *
39: * @see Throwable#getMessage
40: */
41: public String getMessage();
42:
43: /**
44: * Returns the first {@link Throwable} from {@link #getNestedThrowables}
45: * in order to conform to {@link Throwable#getCause} in Java 1.4+.
46: *
47: * @see Throwable#getCause
48: */
49: public Throwable getCause();
50:
51: /**
52: * Stack.
53: *
54: * @see Throwable#printStackTrace
55: */
56: public void printStackTrace();
57:
58: /**
59: * Exception type.
60: */
61: public int getType();
62:
63: /**
64: * Exception subtype.
65: */
66: public int getSubtype();
67:
68: /**
69: * Whether this error is fatal.
70: */
71: public boolean isFatal();
72:
73: /**
74: * The nested throwables.
75: */
76: public Throwable[] getNestedThrowables();
77:
78: /**
79: * The failed object.
80: */
81: public Object getFailedObject();
82: }
|