-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
use jsonrpsee_types::ErrorObjectOwned; | ||
|
||
#[cold] | ||
pub fn log_fail_parse(arg_pat: &str, ty: &str, e: &dyn std::fmt::Debug, optional: bool) { | ||
pub fn log_fail_parse(arg_pat: &str, ty: &str, err: &ErrorObjectOwned, optional: bool) { | ||
let optional = if optional { "optional " } else { "" }; | ||
tracing::debug!("Error parsing {optional}\"{arg_pat}\" as \"{ty}\": {e:?}"); | ||
tracing::debug!("Error parsing {optional}\"{arg_pat}\" as \"{ty}\": {err}"); | ||
} | ||
|
||
#[cold] | ||
pub fn log_fail_parse_as_object(err: &ErrorObjectOwned) { | ||
tracing::debug!("Failed to parse JSON-RPC params as object: {err}"); | ||
} | ||
|
||
#[cold] | ||
pub fn panic_fail_serialize(param: &str, err: serde_json::Error) -> ! { | ||
panic!("Parameter `{param}` cannot be serialized: {err}"); | ||
} | ||
|
||
#[cfg(debug_assertions)] | ||
#[cold] | ||
pub fn log_fail_parse_as_object(e: &dyn std::fmt::Display) { | ||
tracing::debug!("Failed to parse JSON-RPC params as object: {e}"); | ||
pub fn panic_fail_register() -> ! { | ||
panic!("RPC macro method names should never conflict. This is a bug, please report it."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters