src/result.c file

Abort path for a failed result check.

Functions

auto result_abort(const ResultError* error, const char* expectation, const char* file, int line) -> _Noreturn void
Print an error and abort the process.

Function documentation

_Noreturn void result_abort(const ResultError* error, const char* expectation, const char* file, int line)

Print an error and abort the process.

Parameters
error Error to report. May be NULL.
expectation Extra note, usually from BD_RESULT_EXPECT. May be NULL.
file Call site file. May be NULL.
line Call site line.

BD_RESULT_UNWRAP and BD_RESULT_EXPECT call this when ok is false. A NULL error is reported as an unknown failure. A NULL or empty expectation omits the extra note.