ApiResponseSuspendOperator
Author
skydoves (Jaewoong Eum)
ApiResponseSuspendOperator operates on an ApiResponse which should be handled in the suspension scope. This allows you to handle success and error response instead of the com.skydoves.sandwich.suspendOnSuccess, com.skydoves.sandwich.suspendOnError, com.skydoves.sandwich.suspendOnException transformers. This operator can be applied globally as a singleton instance, or on each ApiResponse one by one.
Constructors
Functions
Link copied to clipboard
Operates the ApiResponse.Failure.Error for handling error responses if the request failed.
Link copied to clipboard
abstract suspend fun onException(apiResponse: ApiResponse.Failure.Exception<T>)
Content copied to clipboard
Operates the ApiResponse.Failure.Exception for handling exception responses if the request get an exception.
Link copied to clipboard
Operates the ApiResponse.Success for handling successful responses if the request succeeds.