Skip to content

Commit e3a5538

Browse files
committed
feat(sdk): Error implements CanRetry
1 parent bff31d5 commit e3a5538

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/rs-sdk/src/error.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::time::Duration;
55
use dapi_grpc::mock::Mockable;
66
use dpp::version::PlatformVersionError;
77
use dpp::ProtocolError;
8-
use rs_dapi_client::DapiClientError;
8+
use rs_dapi_client::{CanRetry, DapiClientError};
99

1010
pub use drive_proof_verifier::error::ContextProviderError;
1111

@@ -97,3 +97,13 @@ impl From<PlatformVersionError> for Error {
9797
Self::Protocol(value.into())
9898
}
9999
}
100+
impl CanRetry for Error {
101+
/// Returns true if the operation can be retried, false means it's unspecified
102+
/// False means
103+
fn can_retry(&self) -> bool {
104+
matches!(
105+
self,
106+
Error::CoreLockedHeightNotYetAvailable(_, _) | Error::QuorumNotFound { .. }
107+
)
108+
}
109+
}

0 commit comments

Comments
 (0)