dwnx_ccerr_set_liberr ===================== Synopsis -------- *#include * .. function:: void dwnx_ccerr_set_liberr(dwnx_ccerr *ccerr, int liberr, const uint8_t *reason, size_t reasonlen) `dwnx_ccerr_set_liberr` sets type and error_code based on *liberr*. *reason* is the reason phrase of length *reasonlen*. This function does not make a copy of the reason phrase. If *liberr* is :macro:`DWNX_ERR_IDLE_CLOSE`, :member:`ccerr->type ` is set to :enum:`dwnx_ccerr_type.DWNX_CCERR_TYPE_IDLE_CLOSE`, and :member:`ccerr->error_code ` to :macro:`DWNX_NO_ERROR`. Otherwise, :member:`ccerr->type ` is set to :enum:`dwnx_ccerr_type.DWNX_CCERR_TYPE_TRANSPORT`, and :member:`ccerr->error_code ` is set to an error code inferred by *liberr* (see `dwnx_err_infer_quic_transport_error_code`).