From 7cba183debcf2cefd90b4c1e7a630fb0c2152d06 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 5 Aug 2023 11:51:26 +0200 Subject: (semi-)proper error handling in matroska --- matroska/src/error.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 matroska/src/error.rs (limited to 'matroska/src/error.rs') diff --git a/matroska/src/error.rs b/matroska/src/error.rs new file mode 100644 index 0000000..02e487d --- /dev/null +++ b/matroska/src/error.rs @@ -0,0 +1,19 @@ +use thiserror::Error; + +#[derive(Debug, Error)] +pub enum Error { + #[error("invalid padding")] + InvalidPadding, + #[error("varint too long")] + VarintTooLong, + #[error("global tags dont provide any context")] + GlobalTagsAsContext, + #[error("invalid length of a exact size type")] + InvalidTypeLen, + #[error("invalid utf8")] + InvalidUTF8, + #[error("unknown id")] + UnknownID, + #[error("io: {0}")] + Io(std::io::Error), +} -- cgit v1.2.3-70-g09d2