inexor_rgf_model_command/
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
33
34
35
36
37
38
39
40
41
#[derive(Debug)]
pub struct NotACommand;

#[derive(Debug)]
pub enum CommandBuilderError {
    NotACommand,
    MissingTrigger,
    MissingExecutor,
}

#[derive(Debug)]
pub struct InvalidCommandArgDefinition(pub serde_json::Error);

impl PartialEq for InvalidCommandArgDefinition {
    fn eq(&self, _: &Self) -> bool {
        false
    }
}

#[derive(Debug, PartialEq)]
pub enum CommandArgsError {
    InvalidCommandArgDefinition(InvalidCommandArgDefinition),
    CommandArgDefinitionMissing,
}

#[derive(Debug, PartialEq)]
pub enum CommandExecutionFailed {
    NotACommand,
    CommandArgsError(CommandArgsError),
    InvalidArgument(String),
    MissingArgumentProperty(String),
    MissingMandatoryArgument(String),
}

#[derive(Debug)]
pub enum NoSuchCommand {
    /// A command with the name wasn't found.
    CommandNotFound(String),
    /// The entity was found but it is not a command.
    NotACommand(NotACommand),
}