handle method

Future handle(
  1. Function function
)

Implementation

Future handle(Function function) async {
  try {
    return await function();
  } on DioError catch (e) {
    try {
      _handleDioError(e);
    } catch (e) {
      if (e is ApiException) {
        throw e;
      } else {
        throw UnhandleApiException();
      }
    }
  }
  throw UnhandleApiException();
}