Skip to content

Commit

Permalink
fix provider parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
HardhatChad committed Aug 7, 2024
1 parent 607b890 commit 5cb0c7d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wasm/solana-client/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ impl HttpProvider {

match serde_json::from_value::<ClientResponse>(request_result.clone()) {
Ok(response) => Ok(response),
Err(_) => Err(serde_json::from_value::<ClientError>(request_result).unwrap()),
Err(err) => {
if let Ok(err) = serde_json::from_value::<ClientError>(request_result) {
Err(err)
} else {
Err(ClientError::new(&err.to_string()))
}
}
}
}
}
Expand Down

0 comments on commit 5cb0c7d

Please sign in to comment.