Skip to main content

try_json

Function try_json 

Source
pub fn try_json<T: Serialize>(val: T) -> Result<ReplyData, Error>
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.