|
cwist
Modern C web framework with libttak runtime
|
Minimal constructors for the framework's tagged error container. More...

Go to the source code of this file.
Functions | |
| cwist_error_t | make_error (cwist_errtype_t type) |
| Initialize a cwist_error_t with the requested storage variant. | |
| bool | cwist_error_is_ok_extern (const cwist_error_t *err) |
| Out-of-line variant of the inline cwist_error_is_ok() helper. | |
| void | cwist_error_dispose (cwist_error_t *err) |
| Release resources owned by an error value. | |
Minimal constructors for the framework's tagged error container.
Definition in file error.c.
| void cwist_error_dispose | ( | cwist_error_t * | err | ) |
Release resources owned by an error value.
Release resources owned by an error value. Currently only CWIST_ERR_JSON owns memory (the cJSON payload); all other variants are no-ops. Safe on success values and on NULL.
Currently only CWIST_ERR_JSON owns memory (the cJSON payload); all other variants are no-ops. Safe on success values and on NULL. The released cJSON pointer is reset to NULL, but the rest of the error value is left as-is.
| err | Error object to release (may be NULL). |
Definition at line 43 of file error.c.
References cap, and CWIST_ERR_JSON.
Referenced by cwist_assets_respond(), cwist_css_bundle(), cwist_css_minify(), cwist_css_scope_generate_stylesheet(), cwist_db_pool_create(), cwist_grpc_stream_send(), cwist_http_response_add_oob(), cwist_http_response_html_redirect(), and cwist_http_response_set_html().
| bool cwist_error_is_ok_extern | ( | const cwist_error_t * | err | ) |
Out-of-line variant of the inline cwist_error_is_ok() helper.
Out-of-line cwist_error_is_ok(), for callers that cannot use a static inline function, such as bindings generated from this header.
Out-of-line cwist_error_is_ok(); see include/cwist/sys/err/cwist_err.h.
Forwards to the inline helper so the two can never disagree. Success means the active channel holds its zero/empty value; NULL counts as success and an unknown errtype counts as failure.
| err | Error object to test (may be NULL). |
err represents success. Definition at line 30 of file error.c.
References cap.
| cwist_error_t make_error | ( | cwist_errtype_t | type | ) |
Initialize a cwist_error_t with the requested storage variant.
Creates an error object initialized with the specified type.
| type | Error payload discriminator to store in the result. |
errtype set and the payload left for the caller to fill. Definition at line 14 of file error.c.
References cap.
Referenced by cwist_accept_socket(), cwist_app_reload_tls(), cwist_app_static(), cwist_app_static_with_cache(), cwist_app_use_db(), cwist_app_use_db_pool(), cwist_app_use_ech(), cwist_app_use_ex(), cwist_app_use_http2(), cwist_app_use_http3(), cwist_app_use_https(), cwist_app_use_https2(), cwist_app_use_https3(), cwist_app_use_nuke_db(), cwist_app_use_redis(), cwist_app_use_scheduler(), cwist_db_exec(), cwist_db_insert_healed(), cwist_db_open(), cwist_db_open_memory(), cwist_db_query(), cwist_db_query_strict(), cwist_db_serialize(), cwist_http2_serve_connection_ex(), cwist_http3_client_request(), cwist_http3_init_context(), cwist_http3_init_context_ephemeral(), cwist_http3_reload_context(), cwist_http3_server_loop(), cwist_http_client_request(), cwist_http_header_add(), cwist_http_response_send_file(), cwist_http_send_response(), cwist_http_send_response_head(), cwist_http_server_loop(), cwist_https_accept(), cwist_https_init_context_with_options(), cwist_https_reload_context(), cwist_https_send_response(), cwist_https_send_response_head(), cwist_https_server_loop(), cwist_nats_connect(), cwist_nats_publish_string(), cwist_nats_subscribe(), cwist_orm_delete(), cwist_orm_exec(), cwist_orm_insert(), cwist_orm_insert_returning_i64(), cwist_orm_insert_returning_json(), cwist_orm_query(), cwist_orm_query_typed(), cwist_orm_select(), cwist_orm_select_one_i64(), cwist_orm_select_one_json(), cwist_orm_update(), cwist_redis_auth(), cwist_redis_command(), cwist_redis_command_argv(), cwist_redis_command_argv_reply(), cwist_redis_del(), cwist_redis_expire(), cwist_redis_get(), cwist_redis_pool_command_argv(), cwist_redis_pool_del(), cwist_redis_pool_get(), cwist_redis_pool_publish(), cwist_redis_pool_set(), cwist_redis_pool_setex(), cwist_redis_publish(), cwist_redis_set(), cwist_redis_setex(), cwist_redis_subscribe(), cwist_sstring_adopt_len(), cwist_sstring_adopt_region(), cwist_sstring_append(), cwist_sstring_append_escaped(), cwist_sstring_append_len(), cwist_sstring_append_sstring(), cwist_sstring_append_sstring_escaped(), cwist_sstring_assign(), cwist_sstring_assign_len(), cwist_sstring_borrow(), cwist_sstring_change_size(), cwist_sstring_copy(), cwist_sstring_copy_sstring(), cwist_sstring_init(), cwist_sstring_init_escaped(), cwist_sstring_ltrim(), cwist_sstring_rtrim(), and cwist_sstring_seek().