Class ServerFailure
java.lang.Object
com.google.web.bindery.requestfactory.shared.ServerFailure
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 Summary
ConstructorDescriptionConstructs a ServerFailure with null properties.ServerFailure
(String message) Constructs a fatal ServerFailure with null type and null stack trace.ServerFailure
(String message, String exceptionType, String stackTraceString, boolean fatal) Constructs a ServerFailure object. -
Method Summary
Modifier and TypeMethodDescriptionReturn the exception type.Return the failure message.Returns the RequestContext that triggered the ServerFailure.Return the failure stack trace.boolean
isFatal()
Return true if this is a fatal error.void
setRequestContext
(RequestContext requestContext) Sets the RequestContext to return viagetRequestContext()
.
-
Constructor Details
-
ServerFailure
public ServerFailure()Constructs a ServerFailure with null properties. -
ServerFailure
Constructs a fatal ServerFailure with null type and null stack trace. -
ServerFailure
Constructs a ServerFailure object.- Parameters:
message
- a String containing the failure messageexceptionType
- a String containing the exception typestackTraceString
- a String containing the stack trace
-
-
Method Details
-
getExceptionType
Return the exception type.- Returns:
- the exception type as a String
-
getMessage
Return the failure message.- Returns:
- the message as a String
-
getRequestContext
Returns the RequestContext that triggered the ServerFailure. -
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 ofReceiver.onFailure(com.google.web.bindery.requestfactory.shared.ServerFailure)
throws a runtime exception for fatal failures.- Returns:
- whether this is a fatal failure
-