Skip to content

Commit

Permalink
check_status in and_then
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Oct 31, 2024
1 parent c12634f commit 419f52a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kamp/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ impl Context {
let err_h = self.read_fifo_err(tx.clone());
let out_h = self.read_fifo_out(tx);

let status = kak::pipe(self.session, cmd)?;
self.check_status(status)?;
kak::pipe(self.session, cmd)
.map_err(|err| err.into())
.and_then(|status| self.check_status(status))?;

match rx.recv().map_err(anyhow::Error::new)? {
Err(e) => {
Expand Down

0 comments on commit 419f52a

Please sign in to comment.