Package org.apache.geode.cache.execute
Class FunctionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.geode.GemFireException
org.apache.geode.cache.execute.FunctionException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EmptyRegionFunctionException,FunctionInvocationTargetException
Thrown to indicate an error or exceptional condition during the execution of
Functions in GemFire. This exception can be thrown by GemFire as well as user code,
in the implementation of Function.execute(FunctionContext). When FunctionException
is thrown in an implementation of Function.execute(FunctionContext), GemFire will
transmit it back to, and throw it on, the calling side. For example, if a GemFire client executes
a Function on a server, and the function's execute method throws a FunctionException, the server
logs the exception as a warning, and transmits it back to the calling client, which throws it.
This allows for separation of business and error handling logic, as client code that processes
function execution results does not have to deal with errors; errors can be dealt with in the
exception handling logic, by catching this exception.
The exception string provides details on the cause of failure.
- Since:
- GemFire 6.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates new function exception with given error message.FunctionException(String msg) Creates new function exception with given error message.FunctionException(String msg, Throwable cause) Creates new function exception with given error message and optional nested exception.FunctionException(Throwable cause) Creates new function exception given throwable as a cause and source of error message. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddException(Throwable cause) Adds exceptions thrown from different nodes to a dsvoidaddExceptions(Collection<? extends Throwable> ex) Adds the list of exceptions providedReturns the list of exceptions thrown from different nodesMethods inherited from class org.apache.geode.GemFireException
getRootCauseMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FunctionException
public FunctionException()Creates new function exception with given error message.- Since:
- GemFire 6.5
-
FunctionException
Creates new function exception with given error message.- Parameters:
msg- the detail message- Since:
- GemFire 6.0
-
FunctionException
Creates new function exception with given error message and optional nested exception.- Parameters:
msg- the detail messagecause- the cause- Since:
- GemFire 6.0
-
FunctionException
Creates new function exception given throwable as a cause and source of error message.- Parameters:
cause- the cause- Since:
- GemFire 6.0
-
-
Method Details
-
addException
Adds exceptions thrown from different nodes to a ds- Parameters:
cause- The exception to add- Since:
- GemFire 6.5
-
getExceptions
Returns the list of exceptions thrown from different nodes- Returns:
- a list of exceptions
- Since:
- GemFire 6.5
-
addExceptions
Adds the list of exceptions provided- Parameters:
ex- A collection of exceptions to be added- Since:
- GemFire 6.5
-