returnFailure function

String returnFailure(
  1. dynamic exception
)

Implementation

String returnFailure(final exception) {
  if (exception is ServerException) {
    return SERVER_FAILURE_MESSAGE;
  } else if (exception is CacheException) {
    return CACHE_FAILURE_MESSAGE;
  } else if (exception is UnAuthenticatedException) {
    return UNAUTHENTICATED_FAILURE_MESSAGE;
  } else if (exception is SelectFileException) {
    return SELECT_FAIL_FAILURE_MESSAGE;
  } else if (exception is SelectFileFromPhoneExeption) {
    return SELECT_FROM_PHONE_FAILURE_MESSAGE;
  } else if (exception is SelectImageFromGalleryException) {
    return SELECT_FROM_GALLERY_FAILURE_MESSAGE;
  } else if (exception is AccountCreationException) {
    return ACCOUNT_FAILURE_MESSAGE;
  } else if (exception is PermissionException) {
    return PERMISSION_FAILURE_MESSAGE;
  } else if (exception is PermissionNeverAskedException) {
    return PERMISSION_NEVER_ASKED_FAILURE_MESSAGE;
  } else if (exception is NetworkInfoException) {
    return NETWORK_FAILURE_MESSAGE;
  } else if (exception is ServerMaintainException) {
    return SERVER_MAINTAINCE_FAILURE_MESSAGE;
  } else if (exception is SocketException) {
    return SOCKET_FAILURE_MESSAGE;
  } else if (exception is LanguageExeption) {
    return LANGUAGE_FAILURE_MESSAGE;
  } else if (exception is NotFoundExeption) {
    return NOT_FOUND_MESSAGE;
  } else if (exception is SelectImageException) {
    return SELECT_IMAGE_FAILURE_MESSAGE;
  } else if (exception is SelectImageFromCameraException) {
    return SELECT_FROM_CAMERA_FAILURE_MESSAGE;
  } else if (exception is SelectImageFromGalleryException) {
    return SELECT_FROM_GALLERY_FAILURE_MESSAGE;
  } else {
    return exception.toString();
  }
}