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
use holochain_types::dht_op::DhtOpType;
use holochain_zome_types::ActionType;
use thiserror::Error;

use crate::scratch::SyncScratchError;
#[derive(Error, Debug)]
pub enum StateQueryError {
    #[error(transparent)]
    Sql(#[from] holochain_sqlite::rusqlite::Error),
    #[error(transparent)]
    Infallible(#[from] std::convert::Infallible),
    #[error(transparent)]
    DatabaseError(#[from] holochain_sqlite::error::DatabaseError),
    #[error(transparent)]
    SerializedBytesError(#[from] holochain_serialized_bytes::SerializedBytesError),
    #[error(transparent)]
    DhtOpError(#[from] holochain_types::dht_op::error::DhtOpError),
    #[error("Unexpected op {0:?} for query")]
    UnexpectedOp(DhtOpType),
    #[error("Unexpected action {0:?} for query")]
    UnexpectedAction(ActionType),
    #[error(transparent)]
    WrongActionError(#[from] holochain_zome_types::WrongActionError),
    #[error(transparent)]
    ActionError(#[from] holochain_zome_types::action::ActionError),
    #[error(transparent)]
    SyncScratchError(#[from] SyncScratchError),
}

pub type StateQueryResult<T> = Result<T, StateQueryError>;