Class FunctionException

All Implemented Interfaces:
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:
  • Constructor Details

    • FunctionException

      public FunctionException()
      Creates new function exception with given error message.
      Since:
      GemFire 6.5
    • FunctionException

      public FunctionException(String msg)
      Creates new function exception with given error message.
      Parameters:
      msg - the detail message
      Since:
      GemFire 6.0
    • FunctionException

      public FunctionException(String msg, Throwable cause)
      Creates new function exception with given error message and optional nested exception.
      Parameters:
      msg - the detail message
      cause - the cause
      Since:
      GemFire 6.0
    • FunctionException

      public FunctionException(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 Details

    • addException

      public void addException(Throwable cause)
      Adds exceptions thrown from different nodes to a ds
      Parameters:
      cause - The exception to add
      Since:
      GemFire 6.5
    • getExceptions

      public List<Throwable> getExceptions()
      Returns the list of exceptions thrown from different nodes
      Returns:
      a list of exceptions
      Since:
      GemFire 6.5
    • addExceptions

      public void addExceptions(Collection<? extends Throwable> ex)
      Adds the list of exceptions provided
      Parameters:
      ex - A collection of exceptions to be added
      Since:
      GemFire 6.5