Package org.apache.velocity.util
Class ExceptionUtils
java.lang.Object
org.apache.velocity.util.ExceptionUtils
Use this to create a new Exception. This will run under JDK 1.3 or greater.
However, it running under JDK 1.4 it will set the cause.
- Since:
- 1.5
- Author:
- Llewellyn Falco
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RuntimeException
createRuntimeException
(String message, Throwable cause) Create a new RuntimeException, setting the cause if possible.static Throwable
createWithCause
(Class clazz, String message, Throwable cause) Create a new Exception, setting the cause if possible.static void
Set the cause of the Exception.
-
Constructor Details
-
ExceptionUtils
public ExceptionUtils()
-
-
Method Details
-
createRuntimeException
Create a new RuntimeException, setting the cause if possible.- Parameters:
message
-cause
-- Returns:
- A runtime exception object.
-
createWithCause
Create a new Exception, setting the cause if possible.- Parameters:
clazz
-message
-cause
-- Returns:
- A Throwable.
-
setCause
Set the cause of the Exception. Will detect if this is not allowed.- Parameters:
onObject
-cause
-
-