pub fn to_json(code: &str, message: Option<&str>) -> String
To generate error JSON string for HTTP body.