1 package org.apache.velocity.exception;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 /**
23 * Base class for Velocity runtime exceptions thrown to the
24 * application layer.
25 *
26 * @author <a href="mailto:kdowney@amberarcher.com">Kyle F. Downey</a>
27 * @version $Id: VelocityException.java 998264 2010-09-17 19:13:02Z apetrelli $
28 */
29 public class VelocityException extends RuntimeException
30 {
31 /**
32 * Version Id for serializable
33 */
34 private static final long serialVersionUID = 1251243065134956045L;
35
36 /**
37 * @param exceptionMessage The message to register.
38 */
39 public VelocityException(final String exceptionMessage)
40 {
41 super(exceptionMessage);
42 }
43
44 /**
45 * @param exceptionMessage The message to register.
46 * @param wrapped A throwable object that caused the Exception.
47 * @since 1.5
48 */
49 public VelocityException(final String exceptionMessage, final Throwable wrapped)
50 {
51 super(exceptionMessage, wrapped);
52 }
53
54 /**
55 * @param wrapped A throwable object that caused the Exception.
56 * @since 1.5
57 */
58 public VelocityException(final Throwable wrapped)
59 {
60 super(wrapped);
61 }
62
63 /**
64 * returns the wrapped Throwable that caused this
65 * MethodInvocationException to be thrown
66 *
67 * @return Throwable thrown by method invocation
68 * @since 1.5
69 * @deprecated Use {@link java.lang.RuntimeException#getCause()}
70 */
71 public Throwable getWrappedThrowable()
72 {
73 return getCause();
74 }
75
76 }