handleException static method

Exception handleException(
  1. Object e
)

Implementation

static Exception handleException(Object e) {
  if (e is SocketException) {
    throw NoInternetConnectionException();
  } else if (e is FormatException) {
    throw BadResponseFormatException();
  } else if (e is HttpException) {
    throw HttpException(e.message);
  } else {
    throw SomethingWentWrongException();
  }
}