You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Solana RPC client (rust) returns "AccountNotFound" for any error that happens when making a "getAccountInfo" call. This is misleading. The caller may match their error handling on mistakenly believe an account is closed if they experience a client-side or network error.
This line is executed when the call was successful, but the account does not exist:
Given that the response is identical (minus the error message), consumers may match on "AccountNotFound" in their code which can lead to unexpected behaviour.
Proposed Solution
Only return "AccountNotFound" when getAccountInfo returns successfully with null content (keep line 3957 as-is). Convert L3974 to return RPCRequestError, instead of RPCUserError (e.g. map_err(RpcError::RpcRequestError)? ).
The text was updated successfully, but these errors were encountered:
Problem
The Solana RPC client (rust) returns "AccountNotFound" for any error that happens when making a "getAccountInfo" call. This is misleading. The caller may match their error handling on mistakenly believe an account is closed if they experience a client-side or network error.
This line is executed when the call was successful, but the account does not exist:
solana/rpc-client/src/nonblocking/rpc_client.rs
Line 3957 in 2971e84
This line is executed for any error, including client-side or network issues:
solana/rpc-client/src/nonblocking/rpc_client.rs
Line 3974 in 2971e84
Given that the response is identical (minus the error message), consumers may match on "AccountNotFound" in their code which can lead to unexpected behaviour.
Proposed Solution
Only return "AccountNotFound" when getAccountInfo returns successfully with null content (keep line 3957 as-is). Convert L3974 to return RPCRequestError, instead of RPCUserError (e.g.
map_err(RpcError::RpcRequestError)?
).The text was updated successfully, but these errors were encountered: