enum NetworkErrorMessage {
  unauthorized,
  noInternet,
  serverError,
  requestCancelled,
  badCertificate,
  unknown,
  notFound,
}

extension NetworkErrorMessageExt on NetworkErrorMessage {
  String get value {
    switch (this) {
      case NetworkErrorMessage.unauthorized:
        return 'Session expired. Please login again.';
      case NetworkErrorMessage.noInternet:
        return 'No internet connection.';
      case NetworkErrorMessage.serverError:
        return 'Server error occurred.';
      case NetworkErrorMessage.requestCancelled:
        return 'Request cancelled.';
      case NetworkErrorMessage.badCertificate:
        return 'Invalid certificate.';
      case NetworkErrorMessage.unknown:
        return 'Something went wrong.';
      case NetworkErrorMessage.notFound:
        return 'Oops,terjadi kesalahan tidak terduga. (404)';
    }
  }
}
