Skip to content

Commit 40b1603

Browse files
committed
fix: build transient error correctly
1 parent af235d0 commit 40b1603

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

stacks-signer/src/client/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ pub enum ClientError {
8383
/// Stacks node does not support a feature we need
8484
#[error("Stacks node does not support a required feature: {0}")]
8585
UnsupportedStacksFeature(String),
86+
/// Invalid response from the stacks node
87+
#[error("Invalid response from the stacks node: {0}")]
88+
InvalidResponse(String),
8689
}
8790

8891
/// Retry a function F with an exponential backoff and notification on transient failure

stacks-signer/src/runloop.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@ impl RunLoop {
297297
if info.reward_cycle != block_reward_cycle {
298298
// If the stacks-node is still processing the burn block, the /v2/pox endpoint
299299
// may return the previous reward cycle. In this case, we should retry.
300-
return Err(backoff::Error::transient(err_msg!(
301-
"Received reward cycle info is not the new block's expected reward cycle. Try again."
300+
return Err(backoff::Error::transient(ClientError::InvalidResponse(
301+
"Received reward cycle info does not match the current burn block height."
302+
.to_string(),
302303
)));
303304
}
304305
Ok(info)

0 commit comments

Comments
 (0)