aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 9ca35a8..6978990 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,6 +1,9 @@
/// Errors potentially returned by this crate.
#[derive(Debug)]
pub enum Error {
+ /// eof
+ EOF,
+
/// failed to create ttyrec frame: got N bytes of data but ttyrec frames
/// can be at most M bytes
FrameTooBig { input: usize },
@@ -8,13 +11,22 @@ pub enum Error {
/// failed to create ttyrec frame: got N seconds but ttyrec frames can be
/// at most M seconds
FrameTooLong { input: u64 },
+
+ /// failed to read from input
+ Read { source: std::io::Error },
+
+ /// failed to write to output
+ Write { source: std::io::Error },
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
+ Self::EOF => write!(f, "eof"),
Self::FrameTooBig { input } => write!(f, "failed to create ttyrec frame: got {} bytes of data, but ttyrec frames can be at most {} bytes", input, u32::max_value()),
Self::FrameTooLong { input } => write!(f, "failed to create ttyrec frame: got {} seconds, but ttyrecs can be at most {} seconds", input, u32::max_value()),
+ Self::Read { source } => write!(f, "failed to read from input: {}", source),
+ Self::Write { source } => write!(f, "failed to write to output: {}", source),
}
}
}