canic_core/ops/request/
mod.rs1mod request;
9mod response;
10
11pub use request::*;
12pub use response::*;
13
14use crate::{Error, ThisError, ids::CanisterRole, ops::OpsError, types::Principal};
15
16#[derive(Debug, ThisError)]
22pub enum RequestOpsError {
23 #[error("canister type {0} not found")]
24 CanisterRoleNotFound(CanisterRole),
25
26 #[error("child canister {0} not found")]
27 ChildNotFound(Principal),
28
29 #[error("canister {0} is not a child of caller {1}")]
30 NotChildOfCaller(Principal, Principal),
31
32 #[error("canister {0}'s parent was not found")]
33 ParentNotFound(Principal),
34
35 #[error("invalid response type")]
36 InvalidResponseType,
37
38 #[error("cannot find the root canister")]
39 RootNotFound,
40}
41
42impl From<RequestOpsError> for Error {
43 fn from(err: RequestOpsError) -> Self {
44 OpsError::from(err).into()
45 }
46}