customErrorHandler method

NetworkException customErrorHandler(
  1. NetworkException exception
)

Implementation

NetworkException customErrorHandler(NetworkException exception) {
  switch (exception) {
    case NoConnection():
      return NoConnection(message: "no network connection");
    case ParseException():
      return ParseException(message: "json parsing exception");
  }
}