pub fn error_reply(id: &WireId<'_>, code: IrErrorCode, message: &str) -> ValueExpand description
A failed reply to the request with this id.
ยงExamples
use protocol_droid::domain::jsonrpc::reply::error_reply;
use protocol_droid::domain::ir::IrErrorCode;
use protocol_droid::domain::jsonrpc::WireId;
let id = WireId::Number(7);
let document = error_reply(&id, IrErrorCode::MethodNotFound, "no such method").to_string();
assert_eq!(
document,
r#"{"error":{"code":-32601,"message":"no such method"},"id":7,"jsonrpc":"2.0"}"#,
);