Package com.rnett.krosstalk.result
APIs for KrosstalkResult
. See the instructions on error handling.
Types
An exception representing a non-success HTTP error code from a Krosstalk method.
The result of a krosstalk call. Can be either an exception in the server method, a Http error, or success.
An exception representing an exception on the server side (i.e. a HTTP 500 response, but with more information).
An exception representing an exception on the server side (i.e. a HTTP 500 response, but with more information).
Functions
Catch and unwrap KrosstalkServerException and KrosstalkHttpError, without converting other exceptions to KrosstalkServerException.
Get a value depending on the type of result.
Get a value depending on the type of result.
Get a value depending on the type of result.
Get the value on success, or onFailure otherwise.
Get the value on success, onServerException on a server exception, or onHttpError on a http error.
Gets the value on success, or the result of onFailure otherwise.
Get the value on success, onServerException on a server exception, or onHttpError on a http error.
Gets the value on success, or the result of onFailure otherwise.
Gets the value on success, or the result of onFailure otherwise.
Handle http errors matching filter.
Handle http errors with status codes of statusCode.
Handle server exceptions matching filter.
Handle server exceptions with a KrosstalkResult.ServerException.className of className.
Handle server exceptions with a KrossalkResult.ServerException.className of className.
Handle server exceptions matching filter as http errors.
Handle server exceptions matching filter as http errors with status code statusCode and a message of KrossalkResult.ServerException.asString.
Handle server exceptions with class names of className as http errors.
Handle server exceptions with class names of className as http errors with status code statusCode and a message of KrossalkResult.ServerException.asString.
Whether the result is a http error.
Whether the result is a server exception.
Transform the success value.
Recover from all http errors. Note that exceptions will not be caught, so KrosstalkResult.HttpError.throwFailureException can be used to throw on unhandled http errors.
Recover from all http errors. Note that exceptions will not be caught, so KrossalkResult.HttpError.throwFailureException can be used to throw on unhandled http errors.
Recover from all server exceptions. Note that exceptions will not be caught, so KrosstalkResult.ServerException.throwFailureException can be used to throw on unhandled server exceptions.
Recover from all server exceptions. Note that exceptions will not be caught, so KrossalkResult.ServerException.throwFailureException can be used to throw on unhandled server exceptions.
Recover from all server exceptions, converting them to a successful value or a http error.
Runs block and wraps the result if it is a success. If block throws, it wraps the resulting exception in KrosstalkResult.ServerException.
Throw a KrosstalkHttpError.
Throw a KrosstalkServerException.
If this is a KrosstalkResult.HttpError, throw KrosstalkHttpError. If this is a KrosstalkResult.ServerException, throw KrosstalkServerException.
If this is a KrosstalkResult.HttpError, throw KrosstalkHttpError.
If this is a KrosstalkResult.ServerException, throw KrosstalkServerException.
Convert a Result to a KrosstalkResult, using KrosstalkResult.ServerException to represent a failure.
Convert to a Result, using the KrosstalkHttpError or KrosstalkServerException exceptions.
Properties
Get the value if successful, otherwise throw with throwOnFailure