aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-25 06:34:48 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-25 06:59:12 -0400
commit05cefcdf32b2d3dc9a2cf3f9b391bfda785bd801 (patch)
tree6fe31dc6961c4ef71da455d572a6663b816879a2 /src/error.rs
parentc8c0dbaba82bd53b7d311a7ba1fe97474e2f398e (diff)
downloadttyrec-05cefcdf32b2d3dc9a2cf3f9b391bfda785bd801.tar.gz
ttyrec-05cefcdf32b2d3dc9a2cf3f9b391bfda785bd801.zip
break it up into files
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>;