Skip to main content

json_err

Macro json_err 

Source
macro_rules! json_err {
    ($status:expr, {$($t:tt)*}) => { ... };
    ({$($t:tt)*}) => { ... };
}
Expand description

Respond to clients an error with JSON data structure

  1. Specify HTTP status code and the response data

json_err!(code, data)

  1. Just specify the response data, the HTTP status code is context-dependent

json_err!(data)