From d0a0fdacfe9dae7359896a3743fa6e2db8af6655 Mon Sep 17 00:00:00 2001 From: Adam Wick Date: Fri, 21 Apr 2023 20:23:20 -0700 Subject: [PATCH] so many error cases. --- src/bin/ngri.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/bin/ngri.rs b/src/bin/ngri.rs index 433972a..0558de4 100644 --- a/src/bin/ngri.rs +++ b/src/bin/ngri.rs @@ -16,18 +16,30 @@ fn main() -> Result<(), BackendError> { ":quit" => break, _ => state.process_input(line_no, command), }, + + // it's not clear to me what this could be, but OK Err(ReadlineError::Io(e)) => { eprintln!("IO error: {}", e); break; } + + // Control-D and Control-C Err(ReadlineError::Eof) => break, Err(ReadlineError::Interrupted) => break, + + // For some reason this doesn't exist on Windows. I also don't quite know + // what would cause this, but ... #[cfg(not(windows))] Err(ReadlineError::Errno(e)) => { eprintln!("Unknown syscall error: {}", e); break; } + + // We don't actually do any reflow-ing if we change the terminal size, + // so we can just ignore this. Err(ReadlineError::WindowResized) => continue, + + // Why on earth are there so many error types? Err(e) => { eprintln!("Unknown internal error: {}", e); break;