diff --git a/src/jsonrpc/error.rs b/src/jsonrpc/error.rs index 4ce7358..e7d35a1 100644 --- a/src/jsonrpc/error.rs +++ b/src/jsonrpc/error.rs @@ -171,6 +171,15 @@ impl Error { pub const fn content_modified() -> Self { Error::new(ErrorCode::ContentModified) } + + /// Sets a custom `message`. + pub const fn message(mut self, message: M) -> Self + where + M: Into>, + { + self.message = message.into(); + self + } } impl Display for Error {