archivist_lib/events/
error.rsuse crate::events::types::Event;
use fidl_fuchsia_component as fcomponent;
use futures::channel::mpsc;
use moniker::MonikerError;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum EventError {
#[error(transparent)]
Fidl(#[from] fidl::Error),
#[error("incorrect capability name {received} (expected {expected})")]
IncorrectName { received: String, expected: &'static str },
#[error("received an invalid event type {0:?}")]
InvalidEventType(fcomponent::EventType),
#[error("missing `{0}`")]
MissingField(&'static str),
#[error("received an unknown event result {0:?}")]
UnknownResult(fcomponent::EventPayload),
#[error("expected a result in the fuchsia.sys2 event, but none was found")]
ExpectedResult,
#[error("Component error: {0:?}")]
ComponentError(fcomponent::Error),
#[error(transparent)]
SendError(#[from] mpsc::TrySendError<Event>),
#[error(transparent)]
Moniker(#[from] MonikerError),
}