ruma_state_res/error.rs
1use ruma_common::OwnedEventId;
2use thiserror::Error;
3
4/// Result type for state resolution.
5pub type Result<T> = std::result::Result<T, Error>;
6
7/// Represents the various errors that arise when resolving state.
8#[derive(Error, Debug)]
9#[non_exhaustive]
10pub enum Error {
11 /// The given event was not found.
12 #[error("Failed to find event {0}")]
13 NotFound(OwnedEventId),
14
15 /// An auth event is invalid.
16 #[error("Invalid auth event: {0}")]
17 AuthEvent(String),
18
19 /// A state event doesn't have a `state_key`.
20 #[error("State event has no `state_key`")]
21 MissingStateKey,
22}