Gemfire JavaDocs
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:
java.io.Serializable
- Direct Known Subclasses:
EmptyRegionFunctionException
,FunctionInvocationTargetException
public class FunctionException extends GemFireException
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:
FunctionService
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FunctionException()
Creates new function exception with given error message.FunctionException(java.lang.String msg)
Creates new function exception with given error message.FunctionException(java.lang.String msg, java.lang.Throwable cause)
Creates new function exception with given error message and optional nested exception.FunctionException(java.lang.Throwable cause)
Creates new function exception given throwable as a cause and source of error message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addException(java.lang.Throwable cause)
Adds exceptions thrown from different nodes to a dsvoid
addExceptions(java.util.Collection<? extends java.lang.Throwable> ex)
Adds the list of exceptions providedjava.util.List<java.lang.Throwable>
getExceptions()
Returns the list of exceptions thrown from different nodes-
Methods inherited from class org.apache.geode.GemFireException
getRootCause
-
-
-
-
Constructor Detail
-
FunctionException
public FunctionException()
Creates new function exception with given error message.- Since:
- GemFire 6.5
-
FunctionException
public FunctionException(java.lang.String msg)
Creates new function exception with given error message.- Parameters:
msg
- the detail message- Since:
- GemFire 6.0
-
FunctionException
public FunctionException(java.lang.String msg, java.lang.Throwable cause)
Creates new function exception with given error message and optional nested exception.- Parameters:
msg
- the detail messagecause
- the cause- Since:
- GemFire 6.0
-
FunctionException
public FunctionException(java.lang.Throwable cause)
Creates new function exception given throwable as a cause and source of error message.- Parameters:
cause
- the cause- Since:
- GemFire 6.0
-
-
Method Detail
-
addException
public void addException(java.lang.Throwable cause)
Adds exceptions thrown from different nodes to a ds- Parameters:
cause
- The exception to add- Since:
- GemFire 6.5
-
getExceptions
public java.util.List<java.lang.Throwable> getExceptions()
Returns the list of exceptions thrown from different nodes- Returns:
- a list of exceptions
- Since:
- GemFire 6.5
-
addExceptions
public void addExceptions(java.util.Collection<? extends java.lang.Throwable> ex)
Adds the list of exceptions provided- Parameters:
ex
- A collection of exceptions to be added- Since:
- GemFire 6.5
-
-