safeCallCacheStatus<T> method

Future<Either<String, T>> safeCallCacheStatus<T>(
  1. T? response
)

Implementation

Future<Either<String, T>> safeCallCacheStatus<T>(T? response) async {
  try {
    if (response != null) {
      return await right(response);
    } else {
      return await left("Error");
    }
  } catch (e) {
    final failure = returnFailure(e);
    return left(failure);
  }
}