Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions rusqlite_migration/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,19 @@ impl Error {
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::SpecifiedSchemaVersion(e) => write!(f, "rusqlite_migrate error: {e}"),
// TODO Format the error with fmt instead of debug
_ => write!(f, "rusqlite_migrate error: {self:?}"),
Error::RusqliteError { query, err: e } => write!(
f,
"rusqlite_migration error while executing query '{query}': {e}"
),
Error::SpecifiedSchemaVersion(e) => {
write!(f, "error with the specified schema version: {e}")
}
Error::MigrationDefinition(e) => {
todo!()
}
Error::ForeignKeyCheck(vec) => todo!(),
Error::Unrecognized(ref e) => todo!(),
Error::Hook(_) | Error::FileLoad(_) | Error::InvalidUserVersion => todo!(),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ source: rusqlite_migration/src/errors/tests.rs
expression: e
snapshot_kind: text
---
rusqlite_migrate error: RusqliteError { query: "SELECT * FROM table42;", err: InvalidQuery }
rusqlite_migrate error while executing query 'SELECT * FROM table42;': Query is not read-only
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ source: rusqlite_migration/src/errors/tests.rs
expression: e
snapshot_kind: text
---
rusqlite_migrate error: Attempt to migrate to version 0 (no version set), which is higher than the highest version currently supported, 0 (no version set).
error with the specified schema version: Attempt to migrate to version 0 (no version set), which is higher than the highest version currently supported, 0 (no version set).
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ source: rusqlite_migration/src/errors/tests.rs
expression: e
snapshot_kind: text
---
rusqlite_migrate error: Attempt to use a schema version higher than supported.
error with the specified schema version: Attempt to use a schema version higher than supported.
Loading