1use sinter_core::GraphError;
2
3#[derive(Debug, thiserror::Error)]
4pub enum StoreError {
5 #[error("database error: {0}")]
6 Database(#[from] redb::DatabaseError),
7 #[error("transaction error: {0}")]
8 Transaction(#[from] redb::TransactionError),
9 #[error("table error: {0}")]
10 Table(#[from] redb::TableError),
11 #[error("storage error: {0}")]
12 Storage(#[from] redb::StorageError),
13 #[error("commit error: {0}")]
14 Commit(#[from] redb::CommitError),
15 #[error("codec error: {0}")]
16 Codec(#[from] postcard::Error),
17 #[error("stored graph violates an invariant: {0}")]
18 Invariant(#[from] GraphError),
19 #[error("cannot reset outdated database: {0}")]
20 Reset(std::io::Error),
21 #[error(
22 "graph was built by a newer sinter (schema v{stored}, this binary writes v{supported}) — upgrade sinter, or delete .sinter/graph.redb to rebuild at v{supported}"
23 )]
24 NewerSchema { stored: u32, supported: u32 },
25 #[error("facts compression error: {0}")]
26 Compress(std::io::Error),
27 #[error("store opened read-only; this operation writes")]
28 ReadOnly,
29 #[error("compaction error: {0}")]
30 Compaction(#[from] redb::CompactionError),
31}