From f1ab14ec4334eff2150b0809f52134a4d7006a95 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Mon, 8 Apr 2024 16:23:45 +0530 Subject: [PATCH] refactor: error when psbt finalization fails --- src/job/batch_signing.rs | 4 +++- src/job/error.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/job/batch_signing.rs b/src/job/batch_signing.rs index 0af00a7e..a970a3b8 100644 --- a/src/job/batch_signing.rs +++ b/src/job/batch_signing.rs @@ -165,7 +165,9 @@ pub async fn execute( } (Ok(None), _) => { span.record("finalization_status", "stalled_due_to_finalization"); - Ok((data, false)) + Err(JobError::BatchSigningStalled( + "Stalled during PSBT finalization", + )) } _ if stalled => { span.record("finalization_status", "stalled"); diff --git a/src/job/error.rs b/src/job/error.rs index d1a562a6..04360866 100644 --- a/src/job/error.rs +++ b/src/job/error.rs @@ -57,6 +57,8 @@ pub enum JobError { PsbtMissingInSigningSessions, #[error("JobError - psbt::Error: {0}")] PsbtError(#[from] psbt::Error), + #[error("JobError - BatchSigningStalled: {0}")] + BatchSigningStalled(&'static str), } impl JobExecutionError for JobError {}