Class ServerFailure

java.lang.Object
com.google.web.bindery.requestfactory.shared.ServerFailure

public class ServerFailure extends Object
Describes a request failure on the server.

This error reporting mechanism is adequate at best. When RequestFactory is extended to handle polymorphic types, this class will likely be replaced with something more expressive.

  • Constructor Details

    • ServerFailure

      public ServerFailure()
      Constructs a ServerFailure with null properties.
    • ServerFailure

      public ServerFailure(String message)
      Constructs a fatal ServerFailure with null type and null stack trace.
    • ServerFailure

      public ServerFailure(String message, String exceptionType, String stackTraceString, boolean fatal)
      Constructs a ServerFailure object.
      Parameters:
      message - a String containing the failure message
      exceptionType - a String containing the exception type
      stackTraceString - a String containing the stack trace
  • Method Details

    • getExceptionType

      public String getExceptionType()
      Return the exception type.
      Returns:
      the exception type as a String
    • getMessage

      public String getMessage()
      Return the failure message.
      Returns:
      the message as a String
    • getRequestContext

      public RequestContext getRequestContext()
      Returns the RequestContext that triggered the ServerFailure.
    • getStackTraceString

      public String getStackTraceString()
      Return the failure stack trace.
      Returns:
      the stack trace as a String
    • isFatal

      public boolean isFatal()
      Return true if this is a fatal error. The default implementation of Receiver.onFailure(com.google.web.bindery.requestfactory.shared.ServerFailure) throws a runtime exception for fatal failures.
      Returns:
      whether this is a fatal failure
    • setRequestContext

      public void setRequestContext(RequestContext requestContext)
      Sets the RequestContext to return via getRequestContext().