Skip to content

Commit

Permalink
bubble up this newterm error
Browse files Browse the repository at this point in the history
as suggested here: gyscos#778 (comment)

Co-authored-by: Alexandre Bury <[email protected]>
  • Loading branch information
correabuscar and gyscos committed May 28, 2024
1 parent 487c63e commit 0499c15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cursive/src/backends/curses/n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Backend {
let path = CString::new(output_path).unwrap();
unsafe { libc::fopen(path.as_ptr(), mode.as_ptr()) }
};
let _ = ncurses::newterm(None, output, input).unwrap();
ncurses::newterm(None, output, input).map_err(|_| io::Error::new(io::ErrorKind::Other, "could not call newterm"))?;
// unwrap() is guaranteed not* to panic here ^ unless the underlaying
// ncurses-rs implementation changes API in the future and returns Err
// for other reasons as well, which we do want to catch/panic due to.
Expand Down

0 comments on commit 0499c15

Please sign in to comment.