107 inline std::unexpected<Error>
makeError(
ErrorCode code, std::string message, std::uint32_t nativeError = 0) {
108 return std::unexpected(
Error{code, std::move(message), nativeError});
constexpr std::string_view to_string(ErrorCode code)
The enumerator spelling of code, obtained via reflection.
std::expected< T, Error > Result
Every fallible wowlib operation returns Result<T>; bindings translate the error branch into a target-...
std::unexpected< Error > makeError(ErrorCode code, std::string message, std::uint32_t nativeError=0)
Shorthand for constructing the error branch of a Result.
ErrorCode
Machine-readable failure category carried by every Error.
@ FdidNotResolvable
No path is known for the given FileDataID.
@ TableUnknown
The schema catalog knows no table of the requested name.
@ FileNotFound
The file exists nowhere in the overlay or storage.
@ StorageOpenFailed
The client storage (MPQ chain / CASC) failed to initialize.
@ EncryptedContent
Content is behind an unknown TACT encryption key.
@ UnsupportedClientVersion
No format instantiation exists for the requested client version.
@ InvalidEntityState
An entity's members disagree (e.g.
@ PathNotResolvable
No FileDataID is known for the given path (listfile miss).
@ SchemaMismatch
A client-database record layout disagrees with the generated WoWDBDefs schema.
@ ListfileParseError
Malformed listfile CSV content.
@ SchemaBlobInvalid
A WDBS schema blob (or WoWDBDefs source) is malformed or truncated.
@ TableMagicUnknown
A client-database magic wowlib does not support for the requested version.
@ FormatVersionMismatch
The file's version chunk disagrees with the requested version.
@ InvalidPath
A path that cannot be normalized/used.
@ BackendError
Unclassified StormLib/CascLib failure; see nativeError.
@ StorageNotOpen
Operation on a closed or moved-from storage.
@ FdidSpaceExhausted
The custom FileDataID allocator ran out of u32 space.
@ ListfileIoError
The listfile could not be read or written.
@ NotImplemented
Placeholder during phased implementation.
@ NotSupported
Operation not supported by this backend/provider.
@ OffsetOutOfBounds
An offset array (M2Array) points outside its base buffer.
@ ChunkSizeMismatch
A chunk's size disagrees with its binary struct layout.
@ TableTruncated
A client-database header, record block or satellite block overruns the file.
@ DuplicatePath
Registering a path that already has a FileDataID.
@ ArchiveOpenFailed
A single archive within an MPQ chain failed to open.
@ ChunkTruncated
A chunk header or payload overruns the file buffer.
@ ChunkMissing
A chunk the format requires is absent from the file.
@ IoError
Generic filesystem I/O failure (project directory).
constexpr std::string_view enumName(E value)
The enumerator name of value, straight from reflection — no handwritten stringification tables anywhe...
Internal C++26 reflection utilities (<meta> based).
A wowlib operation failure: a machine-readable code, a human-readable message, and the originating na...
std::uint32_t nativeError
Raw GetCascError()/GetLastError() value from the native library, 0 if not applicable.
ErrorCode code
The failure category.
std::string message
Human-readable description of what failed, with context.