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