aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
new file mode 100644
index 0000000..923ad4f
--- /dev/null
+++ b/src/error.rs
@@ -0,0 +1,17 @@
+#[derive(Debug, snafu::Snafu)]
+#[snafu(visibility(pub))]
+pub enum Error {
+ #[snafu(display("failed to create ttyrec frame: got {} bytes of data, but ttyrec frames can be at most {} bytes", input, u32::max_value()))]
+ FrameTooBig { input: usize },
+
+ #[snafu(display("failed to create ttyrec frame: got {} seconds, but ttyrecs can be at most {} seconds", input, u32::max_value()))]
+ FrameTooLong { input: u64 },
+
+ #[snafu(display("failed to read from file: {}", source))]
+ ReadFile { source: tokio::io::Error },
+
+ #[snafu(display("failed to write to file: {}", source))]
+ WriteFile { source: tokio::io::Error },
+}
+
+pub type Result<T> = std::result::Result<T, Error>;