iceberg-cpp
Loading...
Searching...
No Matches
Classes | Namespaces | Concepts | Macros | Typedefs | Enumerations
result.h File Reference

Define Result, Status, and error helpers. More...

#include <concepts>
#include <format>
#include <string>
#include <type_traits>
#include "iceberg/compat/expected.h"
#include "iceberg/iceberg_export.h"

Go to the source code of this file.

Classes

struct  iceberg::Error
 Error with a kind and a message. More...
 
struct  iceberg::DefaultError< T >
 /brief Default error trait More...
 

Namespaces

namespace  iceberg
 Core Apache Iceberg C++ APIs.
 

Concepts

concept  iceberg::AsResult
 

Macros

#define DEFINE_ERROR_FUNCTION(name)
 Macro to define error creation functions.
 

Typedefs

template<typename T , typename E = typename DefaultError<T>::type>
using iceberg::Result = ::iceberg::expected< T, E >
 Result alias.
 
using iceberg::Status = Result< void >
 
template<AsResult T>
using iceberg::ResultValueT = typename std::remove_cvref_t< T >::value_type
 

Enumerations

enum class  iceberg::ErrorKind {
  kAlreadyExists , kAuthenticationFailed , kBadRequest , kCommitFailed ,
  kCommitStateUnknown , kCompressError , kDecompressError , kForbidden ,
  kInternalServerError , kInvalid , kInvalidArgument , kInvalidArrowData ,
  kInvalidExpression , kInvalidManifest , kInvalidManifestList , kInvalidSchema ,
  kIOError , kJsonParseError , kNamespaceNotEmpty , kNoSuchNamespace ,
  kNoSuchPlanId , kNoSuchPlanTask , kNoSuchTable , kNoSuchWarehouse ,
  kNoSuchView , kNotAllowed , kNotAuthorized , kNotFound ,
  kNotImplemented , kNotSupported , kRestError , kRetryableValidationFailed ,
  kServiceUnavailable , kTokenExpired , kUnknownError , kValidationFailed
}
 Error types for iceberg.
 

Detailed Description

Define Result, Status, and error helpers.

Macro Definition Documentation

◆ DEFINE_ERROR_FUNCTION

#define DEFINE_ERROR_FUNCTION (   name)
Value:
template <typename... Args> \
inline auto name(const std::format_string<Args...> fmt, Args&&... args) \
return ::iceberg::unexpected<Error>( \
{ErrorKind::k##name, std::format(fmt, std::forward<Args>(args)...)}); \
} \
inline auto name(std::string message) -> ::iceberg::unexpected<Error> { \
return ::iceberg::unexpected<Error>({ErrorKind::k##name, std::move(message)}); \
}
Definition expected.h:246

Macro to define error creation functions.