Skip to content

Commit

Permalink
misc: apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed Nov 10, 2023
1 parent c46a574 commit 0f39220
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/edr_napi/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ impl Provider {
#[doc = "Handles a JSON-RPC request and returns a JSON-RPC response."]
#[napi]
pub async fn handle_request(&self, json_request: String) -> napi::Result<String> {
let request = serde_json::from_str(&json_request)
.map_err(|e| napi::Error::new(Status::InvalidArg, e.to_string()))?;
let request = serde_json::from_str(&json_request).map_err(|error| {
napi::Error::new(
Status::InvalidArg,
format!("Invalid JSON `{json_request}` due to: {error}"),
)
})?;

let response = self
.provider
Expand Down

0 comments on commit 0f39220

Please sign in to comment.