Represents an error occurred during Crunch operations.
More...
#include <crunch_types.hpp>
|
|
constexpr bool | operator== (const Error &other) const noexcept=default |
| |
|
constexpr bool | operator== (ErrorCode c) const noexcept |
| | Checks if the error matches a specific error code.
|
| |
|
|
static constexpr Error | integrity () noexcept |
| | Creates an error representing an integrity check failure.
|
| |
| template<size_t N> |
| static constexpr Error | validation (FieldId id, const char(&msg)[N]) noexcept |
| | Creates an error representing a validation failure.
|
| |
| static constexpr Error | deserialization (std::string_view msg="deserialization error") noexcept |
| | Creates an error representing a deserialization failure.
|
| |
|
static constexpr Error | invalid_message_id () noexcept |
| | Creates an error representing an invalid message ID.
|
| |
|
static constexpr Error | invalid_format () noexcept |
| | Creates an error representing an invalid serialization format.
|
| |
| template<size_t N> |
| static constexpr Error | capacity_exceeded (FieldId id, const char(&msg)[N]) noexcept |
| | Creates an error representing capacity exceeded. Used for strings and aggregated fields.
|
| |
Represents an error occurred during Crunch operations.
Contains an error code, an optional field ID related to the error, and a descriptive message.
◆ capacity_exceeded()
template<size_t N>
| static constexpr Error Crunch::Error::capacity_exceeded |
( |
FieldId |
id, |
|
|
const char(&) |
msg[N] |
|
) |
| |
|
inlinestaticconstexprnoexcept |
Creates an error representing capacity exceeded. Used for strings and aggregated fields.
- Template Parameters
-
| N | Size of the message string literal. |
- Parameters
-
| id | The FieldId. |
| msg | Description. |
◆ deserialization()
| static constexpr Error Crunch::Error::deserialization |
( |
std::string_view |
msg = "deserialization error" | ) |
|
|
inlinestaticconstexprnoexcept |
Creates an error representing a deserialization failure.
- Parameters
-
| msg | Description of the deserialization error. |
◆ validation()
template<size_t N>
| static constexpr Error Crunch::Error::validation |
( |
FieldId |
id, |
|
|
const char(&) |
msg[N] |
|
) |
| |
|
inlinestaticconstexprnoexcept |
Creates an error representing a validation failure.
- Template Parameters
-
| N | Size of the message string literal. |
- Parameters
-
| id | The FieldId that failed validation. |
| msg | The failure description. |
◆ field_id
| FieldId Crunch::Error::field_id {0} |
ID of the field associated with the error (0 if not applicable).
The documentation for this struct was generated from the following file: