From 5cb0c7d4804192a1ecb1686c18ceb4d8060a325a Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Wed, 7 Aug 2024 14:12:14 -0700 Subject: [PATCH] fix provider parsing error --- wasm/solana-client/src/provider.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wasm/solana-client/src/provider.rs b/wasm/solana-client/src/provider.rs index 41338740..d62e6243 100644 --- a/wasm/solana-client/src/provider.rs +++ b/wasm/solana-client/src/provider.rs @@ -36,7 +36,13 @@ impl HttpProvider { match serde_json::from_value::(request_result.clone()) { Ok(response) => Ok(response), - Err(_) => Err(serde_json::from_value::(request_result).unwrap()), + Err(err) => { + if let Ok(err) = serde_json::from_value::(request_result) { + Err(err) + } else { + Err(ClientError::new(&err.to_string())) + } + } } } }