dm_database_parser_sqllog/
error.rs1use thiserror::Error;
6
7#[derive(Debug, Clone, PartialEq, Error)]
11pub enum ParseError {
12 #[error("invalid format")]
14 InvalidFormat,
15
16 #[error("file not found or inaccessible: {0}")]
18 FileNotFound(String),
19
20 #[error("empty input: no lines provided")]
22 EmptyInput,
23
24 #[error("invalid record start line: line does not match expected format")]
26 InvalidRecordStartLine,
27
28 #[error("line too short: expected at least 25 characters, got {0}")]
30 LineTooShort(usize),
31
32 #[error("missing closing parenthesis in meta section")]
34 MissingClosingParen,
35
36 #[error("insufficient meta fields: expected at least 7 fields, got {0}")]
38 InsufficientMetaFields(usize),
39
40 #[error("invalid EP format: expected 'EP[number]', got '{0}'")]
42 InvalidEpFormat(String),
43
44 #[error("failed to parse EP number: {0}")]
46 EpParseError(String),
47
48 #[error("invalid field format: expected '{expected}', got '{actual}'")]
50 InvalidFieldFormat {
51 expected: String,
53 actual: String,
55 },
56
57 #[error("failed to parse {field} as integer: {value}")]
59 IntParseError {
60 field: String,
62 value: String,
64 },
65
66 #[error("failed to parse indicators: {0}")]
68 IndicatorsParseError(String),
69}