macro_rules! json_err {
($status:expr, {$($t:tt)*}) => { ... };
({$($t:tt)*}) => { ... };
}Expand description
Respond to clients an error with JSON data structure
- Specify HTTP status code and the response data
json_err!(code, data)
- Just specify the response data, the HTTP status code is context-dependent
json_err!(data)