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
use thiserror::*;
use crate::{borrow::Borrows, SystemName};
#[doc(hidden)]
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("Attempt to execute query: {query:?} on incompatible subworld: {subworld:?}")]
#[doc(hidden)]
IncompatibleSubworld { subworld: Borrows, query: Borrows },
#[error("Entity: {0:?} does not exist in world")]
#[doc(hidden)]
NoSuchEntity(hecs::Entity),
#[error("The entity did not have the desired component")]
#[doc(hidden)]
ComponentError(#[from] hecs::ComponentError),
#[error("Context does not have data of type {0:?}")]
#[doc(hidden)]
MissingData(&'static str),
#[error("Data of type {0:?} is already mutable borrowed")]
#[doc(hidden)]
Borrow(&'static str),
#[error("Data of type {0:?} is already borrowed")]
#[doc(hidden)]
BorrowMut(&'static str),
#[error("Failed to execute system {0:?}")]
#[doc(hidden)]
SystemError(SystemName, #[source] anyhow::Error),
}