use std::io;
use std::path::PathBuf;
use notify::Error as NotifyError;
use thiserror::Error;
pub type SessionResult<T> = Result<T, SessionError>;
#[derive(Debug, Error)]
pub enum SessionError {
#[error("failed to create session file watcher: {0}")]
WatcherInit(#[from] NotifyError),
#[error("failed to watch index file at {path}: {source}")]
WatchIndex {
path: PathBuf,
#[source]
source: NotifyError,
},
#[error("failed to unwatch index file at {path}: {source}")]
UnwatchIndex {
path: PathBuf,
#[source]
source: NotifyError,
},
#[error("failed to read metadata for {path}: {source}")]
IndexMetadata {
path: PathBuf,
#[source]
source: io::Error,
},
#[error("failed to load symbol index from {path}: {source}")]
IndexLoad {
path: PathBuf,
#[source]
source: crate::Error,
},
#[error("failed to execute query: {0}")]
QueryExecution(#[source] crate::Error),
#[error("failed to parse query: {0}")]
QueryParse(String),
#[error("failed to spawn session maintenance thread: {0}")]
SpawnThread(#[source] io::Error),
}