handleApiError<T> method

Future<T> handleApiError <T>(Future<T> requestFunction())

Implementation

static Future<T> handleApiError<T>(
    Future<T> Function() requestFunction) async {
  try {
    return await requestFunction();
  } on DioError catch (e) {
    throw transformApiError(e);
  }
}