Skip to main content

nexus_watcher/events/
errors.rs

1use serde::{Deserialize, Serialize};
2use thiserror::Error;
3
4#[derive(Error, Debug, Clone, Serialize, Deserialize)]
5pub enum EventProcessorError {
6    /// Failed to execute query in the graph database
7    #[error("GraphQueryFailed: {message}")]
8    GraphQueryFailed { message: String },
9    /// The event could not be indexed due to missing graph dependencies
10    #[error("MissingDependency: Could not be indexed")]
11    MissingDependency { dependency: Vec<String> },
12    /// Failed to complete indexing due to a Redis write error
13    #[error("IndexWriteFailed: Indexing incomplete due to Redis error - {message}")]
14    IndexWriteFailed { message: String },
15    /// The event appear to be unindexed. Verify the event in the retry queue
16    #[error("SkipIndexing: The PUT event appears to be unindexed")]
17    SkipIndexing,
18    /// The event could not be parsed from a line
19    #[error("InvalidEventLine: {message}")]
20    InvalidEventLine { message: String },
21    /// The Pubky client could not resolve the pubky
22    #[error("PubkyClientError: {message}")]
23    PubkyClientError { message: String },
24    // #[error("The event does not exist anymore in the homeserver")]
25    // ContentNotFound { dependency: String },
26    // #[error("PubkyClient could not reach/resolve the homeserver")]
27    // NotResolvedHomeserver,
28}