Skip to main content

decode_json

Function decode_json 

Source
pub fn decode_json<T: DeserializeOwned>(
    path: &str,
    text: &str,
) -> Result<T, Error>
Expand description

Decode a response body as JSON, logging a failure once.

A failure logs one ERROR line under polyoxide_core, Failed to decode {path}: {err}: {body}, with the body truncated for the log, and returns the error for the caller to map into its own type.