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())) + } + } } } }