handleError method

void handleError(
  1. dynamic error
)

Implementation

void handleError(error) {
  hideLoading();
  var message = error.message;
  if (error is BadRequestException) {
    DialogHelper.showErrorDialog(desc: message);
  } else if (error is FetchDataException) {
    DialogHelper.showErrorDialog(desc: message);
  } else if (error is ApiNotRespondingException) {
    DialogHelper.showErrorDialog(desc: 'Oops! It took longer to respond');
  } else if (error is UnauthorizedException) {
    DialogHelper.showErrorDialog(desc: message);
  } else if (error is NotFoundException) {
    DialogHelper.showErrorDialog(desc: 'Oops! you are not authorized');
  }
}