swarm repositories / source
aboutsummaryrefslogtreecommitdiff
path: root/crates/fidget-spinner-core/src/error.rs
blob: a095f579d2e8daed8de570263f7ee2f4f66166ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use thiserror::Error;

#[derive(Clone, Debug, Eq, Error, PartialEq)]
pub enum CoreError {
    #[error("text values must not be blank")]
    EmptyText,
    #[error("tag names must not be blank")]
    EmptyTagName,
    #[error(
        "invalid tag name `{0}`; expected lowercase ascii alphanumerics separated by `-`, `_`, or `/`"
    )]
    InvalidTagName(String),
    #[error("slug values must not be blank")]
    EmptySlug,
    #[error("invalid slug `{0}`; expected lowercase ascii alphanumerics separated by `-` or `_`")]
    InvalidSlug(String),
    #[error("slug `{0}` is ambiguous with a UUID selector")]
    UuidLikeSlug(String),
    #[error("command recipes must contain at least one argv element")]
    EmptyCommand,
}