Skip to main content

try_json

Function try_json 

Source
pub fn try_json<T>(val: T) -> Result<ReplyData, Error>
where T: Serialize,
Expand description

Fallible counterpart of json. Returns the raw serde_json::Error on failure so callers (notably the reply! macro) can map it to a structured response instead of panicking.