-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.rs
32 lines (31 loc) · 1.04 KB
/
error.rs
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
26
27
28
29
30
31
32
/// An error that occurs in this crate.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
pub struct Error(#[from] ErrorKind);
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, thiserror::Error)]
pub(crate) enum ErrorKind {
#[error("collection path conversion {0}")]
CollectionPathConversion(String),
#[error("contains invalid charactor")]
ContainsInvalidCharacter,
#[error("contains slash")]
ContainsSlash,
#[error("document id conversion {0}")]
DocumentIdConversion(String),
#[error("ends with hyphen")]
EndsWithHyphen,
#[error("invalid name")]
InvalidName,
#[error("invalid number of path components")]
InvalidNumberOfPathComponents,
#[error("byte length exceeded")]
LengthOutOfBounds,
#[error("matches the regular expression `__.*__`")]
MatchesReservedIdPattern,
#[error("not contains slash")]
NotContainsSlash,
#[error("single period or double periods")]
SinglePeriodOrDoublePeriods,
#[error("starts with non letter")]
StartsWithNonLetter,
}