Which crate is this feature request for (if any)?
payjoin
Question
What is the recommended method for distinguishing between a MaybeTerminalSuccessTransition::FatalTerminate and a MaybeTerminalSuccessTransition::Transient that is persisted? Specifically, after persisting the transition how are callers expected to determine whether the error is for a transient error that should be retried or a fatal error that has closed the session?
For example you can see that currently in payjoin-cli it is currently only handling the MaybeTerminalSuccessTransition::FatalAdvance transition, leaving the other two ambiguously unhandled.
|
if let Err(e) = session.process_error_response(&err_bytes, err_ctx).save(persister) { |
|
if let Some(api_err) = e.api_error_ref() { |
|
tracing::warn!("Failed to confirm error response delivery: {api_err}"); |
|
} |
|
match e.error_state() { |
|
Some(_) => { |
|
let id = persister.session_id(); |
|
println!( |
|
"Session {id} failed. Run `payjoin-cli cancel {id}` to cancel and broadcast the fallback transaction." |
|
); |
|
} |
|
None => return Err(anyhow!("Failed to process error response")), |
|
} |
|
} |
Which crate is this feature request for (if any)?
payjoin
Question
What is the recommended method for distinguishing between a
MaybeTerminalSuccessTransition::FatalTerminateand aMaybeTerminalSuccessTransition::Transientthat is persisted? Specifically, after persisting the transition how are callers expected to determine whether the error is for a transient error that should be retried or a fatal error that has closed the session?For example you can see that currently in
payjoin-cliit is currently only handling theMaybeTerminalSuccessTransition::FatalAdvancetransition, leaving the other two ambiguously unhandled.rust-payjoin/payjoin-cli/src/app/v2/mod.rs
Lines 1040 to 1053 in f60825c