Skip to main content

saya_types/contract/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Clone, PartialEq, Eq, Error)]
4#[non_exhaustive]
5pub enum ContractError {
6    #[error("profile identity is not a valid opaque identifier")]
7    InvalidProfileIdentity,
8
9    #[error("claim id is not a valid identifier")]
10    InvalidClaimId,
11
12    #[error("database object name must not be empty")]
13    EmptyName,
14
15    #[error("database object name is too long")]
16    NameTooLong,
17
18    #[error("value contains control characters")]
19    ControlCharacter,
20
21    #[error("claim text must not be empty")]
22    EmptyText,
23
24    #[error("claim text is too long")]
25    TextTooLong,
26
27    #[error("too many referenced columns")]
28    TooManyColumns,
29
30    #[error("relationship column lists must have equal length")]
31    ColumnCountMismatch,
32
33    #[error("relationship must reference at least one column")]
34    EmptyColumns,
35
36    #[error("schema fingerprint digest is malformed")]
37    InvalidFingerprint,
38
39    /// A preference value was offered at the wrong scope. The string names the
40    /// scope the value requires (`"global"` or `"profile"`). Payload-free by the
41    /// security standard: it never echoes the value the caller tried to store.
42    #[error("preference requires a {0} scope")]
43    ScopeMismatch(&'static str),
44
45    #[error("timezone is not a well-shaped IANA name")]
46    InvalidTimezone,
47
48    #[error("profile name is not valid")]
49    InvalidProfileName,
50}