onError method

  1. @override
FailureResponse onError(
  1. Object error
)

Implementation

@override
FailureResponse onError(Object error) {
  if (error is InvalidResponseRestServiceFailure) {
    return HttpFailureResponse(
      path: error.path,
      statusCode: error.statusCode,
      error: error.error,
    );
  }
  if (error is RestServiceFailure) {
    return UnknownFailureResponse(error.message);
  }
  return UnknownFailureResponse(error.toString());
}