26#include "iceberg/iceberg_export.h"
33 kAuthenticationFailed,
66struct ICEBERG_EXPORT [[nodiscard]]
Error {
78template <typename T, typename E = typename DefaultError<T>::type>
79using Result = std::expected<T, E>;
81using Status = Result<void>;
84#define DEFINE_ERROR_FUNCTION(name) \
85 template <typename... Args> \
86 inline auto name(const std::format_string<Args...> fmt, Args&&... args) \
87 -> std::unexpected<Error> { \
88 return std::unexpected<Error>( \
89 {ErrorKind::k##name, std::format(fmt, std::forward<Args>(args)...)}); \
91 inline auto name(std::string message) -> std::unexpected<Error> { \
92 return std::unexpected<Error>({ErrorKind::k##name, std::move(message)}); \
95DEFINE_ERROR_FUNCTION(AlreadyExists)
96DEFINE_ERROR_FUNCTION(AuthenticationFailed)
97DEFINE_ERROR_FUNCTION(BadRequest)
98DEFINE_ERROR_FUNCTION(CommitFailed)
99DEFINE_ERROR_FUNCTION(CommitStateUnknown)
100DEFINE_ERROR_FUNCTION(DecompressError)
101DEFINE_ERROR_FUNCTION(Forbidden)
102DEFINE_ERROR_FUNCTION(InternalServerError)
103DEFINE_ERROR_FUNCTION(Invalid)
104DEFINE_ERROR_FUNCTION(InvalidArgument)
105DEFINE_ERROR_FUNCTION(InvalidArrowData)
106DEFINE_ERROR_FUNCTION(InvalidExpression)
107DEFINE_ERROR_FUNCTION(InvalidManifest)
108DEFINE_ERROR_FUNCTION(InvalidManifestList)
109DEFINE_ERROR_FUNCTION(InvalidSchema)
110DEFINE_ERROR_FUNCTION(IOError)
111DEFINE_ERROR_FUNCTION(JsonParseError)
112DEFINE_ERROR_FUNCTION(NamespaceNotEmpty)
113DEFINE_ERROR_FUNCTION(NoSuchNamespace)
114DEFINE_ERROR_FUNCTION(NoSuchTable)
115DEFINE_ERROR_FUNCTION(NoSuchView)
116DEFINE_ERROR_FUNCTION(NotAllowed)
117DEFINE_ERROR_FUNCTION(NotAuthorized)
118DEFINE_ERROR_FUNCTION(NotFound)
119DEFINE_ERROR_FUNCTION(NotImplemented)
120DEFINE_ERROR_FUNCTION(NotSupported)
121DEFINE_ERROR_FUNCTION(RestError)
122DEFINE_ERROR_FUNCTION(ServiceUnavailable)
123DEFINE_ERROR_FUNCTION(TokenExpired)
124DEFINE_ERROR_FUNCTION(UnknownError)
125DEFINE_ERROR_FUNCTION(ValidationFailed)
127#undef DEFINE_ERROR_FUNCTION
/brief Default error trait
Definition result.h:73
Error with a kind and a message.
Definition result.h:66