1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum DbCoreError {
5 #[error("failed to read snapshot: {0}")]
6 SnapshotRead(String),
7
8 #[error("failed to write snapshot: {0}")]
9 SnapshotWrite(String),
10
11 #[error("failed to write migration: {0}")]
12 MigrationWrite(String),
13
14 #[error("row mapping error: {0}")]
15 RowMapping(String),
16
17 #[error("connection initialization error: {0}")]
18 Connection(String),
19
20 #[error(
21 "cannot migrate virtual table \"{table}\" in place: {reason}; SQLite has no ALTER TABLE for \
22 virtual tables — drop, recreate and repopulate it in a hand-written migration"
23 )]
24 VirtualTableChange { table: String, reason: String },
25
26 #[error("failed to read journal: {0}")]
27 JournalRead(String),
28
29 #[error("failed to write journal: {0}")]
30 JournalWrite(String),
31}