1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum SerdeError {
8 #[error("invalid magic bytes: expected 'TG', got {0:02X} {1:02X}")]
10 InvalidMagic(u8, u8),
11
12 #[error("unsupported version: {0}")]
14 UnsupportedVersion(u8),
15
16 #[error("invalid op code: {0}")]
18 InvalidOpCode(u8),
19
20 #[error("invalid source tag: {0}")]
22 InvalidSourceTag(u8),
23
24 #[error("unexpected end of input at offset {0}")]
26 UnexpectedEof(usize),
27
28 #[error("JSON error: {0}")]
30 Json(#[from] serde_json::Error),
31
32 #[error("invalid graph: {0}")]
34 InvalidGraph(String),
35}