cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
error.c
Go to the documentation of this file.
2#include <string.h>
3
16 memset(&err, 0, sizeof(err));
17 err.errtype = type;
18 return err;
19}
20
31 return cwist_error_is_ok(err);
32}
33
44 if (!err) return;
45 if (err->errtype == CWIST_ERR_JSON && err->error.err_json) {
46 cJSON_Delete(err->error.err_json);
47 err->error.err_json = NULL;
48 }
49}
cwist_errtype_t
Definition cwist_err.h:13
@ CWIST_ERR_JSON
Definition cwist_err.h:37
bool cwist_error_is_ok_extern(const cwist_error_t *err)
Out-of-line variant of the inline cwist_error_is_ok() helper.
Definition error.c:30
void cwist_error_dispose(cwist_error_t *err)
Release resources owned by an error value.
Definition error.c:43
cwist_error_t make_error(cwist_errtype_t type)
Initialize a cwist_error_t with the requested storage variant.
Definition error.c:14
size_t cap
Definition otel.c:56
Integrated error structure used throughout the system.
Definition cwist_err.h:72
Unified error code and type definitions for the CWIST system layer.