lutetium/
errors.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
use crate::identifier::ActorId;
use crate::system::ExtensionMissingError;

#[derive(Debug, thiserror::Error)]
pub enum ActorError {
    #[error("Actor with this identifier: {id} has already been activated.")]
    AlreadySpawned {
        id: ActorId
    },
    
    #[error("The target actor could not be found. actor: `{id}` It may have already been shut down or may not have started.")]
    NotFoundActor {
        id: ActorId
    },

    #[error("Could not execute callback, channel may be closed.")]
    CallBackSend,

    #[error("May have passed different type information than what was expected when downcasting from `Any` to type.")]
    DownCastFromAny,
    
    #[error(transparent)]
    MissingExtension(ExtensionMissingError),
    
    #[error("Not enough values needed to build the structure.")]
    NotEnoughValue,
    
    #[error("Actor activation failed. `{id}`: {reason}")]
    FailedActivation {
        reason: &'static str,
        id: String
    },
    
    #[error(transparent)]
    External(Box<dyn std::error::Error + Sync + Send>),
}