blob: 8a901ce3fc19614920033ce8df0c6a66d69f0eeb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
use thiserror::Error;
#[derive(Debug, Error, PartialEq)]
pub enum ParseError {
#[error("message is empty")]
EmptyMessage,
#[error("missing command")]
MissingCommand,
#[error("invalid tag format: {0}")]
InvalidTag(String),
#[error("line exceeds max message length")]
MessageTooLong,
}
#[derive(Debug, Error)]
pub enum CodecError {
#[error("parse error: {0}")]
Parse(#[from] ParseError),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
}
|