Skip to content

Commit 1b1c4b8

Browse files
committed
Fields for RpcError are public.
1 parent 7ea48b8 commit 1b1c4b8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "json-rpc2"
3-
version = "0.5.2"
3+
version = "0.5.3"
44
authors = ["muji <[email protected]>"]
55
edition = "2018"
66
description = "Simple, robust and pragmatic JSON-RPC 2.0 implementation"

src/lib.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,16 @@ impl Into<Response> for Error {
161161
}
162162

163163
/// Error information for response messages.
164-
#[doc(hidden)]
165164
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
166165
pub struct RpcError {
167-
code: isize,
168-
message: String,
166+
/// The error code.
167+
pub code: isize,
168+
/// The error message.
169+
pub message: String,
170+
/// Additional data for the error, typically an underlying
171+
/// cause for the error.
169172
#[serde(skip_serializing_if = "Option::is_none")]
170-
data: Option<String>,
173+
pub data: Option<String>,
171174
}
172175

173176
/// Trait for services that maybe handle a request.

0 commit comments

Comments
 (0)