mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 18:01:03 +00:00
fail if transaction submit has failed (#1584)
This commit is contained in:
committed by
Bastian Köcher
parent
e534e90193
commit
0f79d1e86e
@@ -236,6 +236,16 @@ impl ProcessFutureResult {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `Ok(())` if future has succeeded.
|
||||
/// Returns `Err(failed_client)` otherwise.
|
||||
pub fn fail_if_error(self, failed_client: FailedClient) -> Result<(), FailedClient> {
|
||||
if self.is_ok() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(failed_client)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns Ok(true) if future has succeeded.
|
||||
/// Returns Ok(false) if future has failed with non-connection error.
|
||||
/// Returns Err if future is `ConnectionFailed`.
|
||||
|
||||
Reference in New Issue
Block a user