56#define ERROR_HEADER srn_error_t *maybe_error
63#define HAS_ERROR(x) ((x).maybe_error != nullptr)
143[[nodiscard]] [[gnu::nonnull(1)]]
148#define ERR(ctx, err, msg) srn_errors_make(ctx, err, msg)
149#define FAIL(ctx, T, err, msg) ((T *)srn_errors_fail(ctx, sizeof(T), alignof(T), err, msg))
159#ifdef SRN_WITH_SERENE
srn_error_tag_t
The kind of a failure.
@ STRING_LENGTH_LIMIT_EXCEEDED
@ INVALID_ARGUMENT
The request itself is malformed (an empty POLL interest mask, for example), so retrying it unchanged ...
@ CHANNEL_BUSY
The channel already has a full ring's worth of operations in flight.
srn_error_tag_t srn_errno_to_tag(int errno_value, srn_error_tag_t default_tag)
Map a POSIX errno to error tag.
void * srn_errors_fail(const srn_context_t *ctx, size_t size, size_t alignment, srn_error_tag_t tag, const char *msg)
Allocate a size/alignment value in ctx, set its ERROR_HEADER (the first member, srn_error_t *maybe_er...
srn_error_t * srn_errors_make(const srn_context_t *ctx, srn_error_tag_t tag, const char *msg)
Build an error in ctx's memory, tagged tag and carrying msg.
A runtime error, a tag classifying the failure and a human-readable message.