GALANTHUS / ABI FUNCTION REFERENCE
gln_get_backend_result_error
Declared in <galanthus/c_api/gln_capi.h>.
GLN_API const gln_error_t* GLN_CALL gln_get_backend_result_error(const gln_backend_result_t* in_result);
Purpose
Returns the borrowed error object stored in a backend result envelope when the envelope represents a local error or provider rejection.
The accessor returns NULL for envelopes whose outcome is neither GLN_BACKEND_OUTCOME_ERROR nor GLN_BACKEND_OUTCOME_REJECTED.
Return
Returns the borrowed error detail stored in a backend result envelope when one is available.
| Type | Nullability | Ownership |
|---|---|---|
const gln_error_t* | nullable | borrowed |
Parameters
| Name | Direction | Type | Nullability | Ownership |
|---|---|---|---|---|
in_result | input | const gln_backend_result_t* | nullable | borrowed |
Notes
Passing NULL for in_result is allowed and returns NULL.
The returned gln_error_t is owned by the backend result envelope. Do not pass it to gln_release_error; gln_destroy_backend_result releases the embedded error with the envelope.
Strings in the returned error and any structured detail handle borrowed with gln_get_error_detail become invalid when gln_destroy_backend_result releases the parent envelope. Copy needed fields before destroying the result.