Skip to content

Commit

Permalink
Clarify InvalidSavepoint meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Oct 14, 2023
1 parent e435401 commit 1c137dd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ impl std::error::Error for DatabaseError {}
#[derive(Debug)]
#[non_exhaustive]
pub enum SavepointError {
/// This savepoint is invalid because an older savepoint was restored after it was created
/// This savepoint is invalid or cannot be created.
///
/// Savepoints become invalid when an older savepoint is restored after it was created,
/// and savepoints cannot be created if the transaction is "dirty" (any tables have been opened)
InvalidSavepoint,
/// Error from underlying storage
Storage(StorageError),
Expand All @@ -269,10 +272,7 @@ impl Display for SavepointError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
SavepointError::InvalidSavepoint => {
write!(
f,
"Savepoint is invalid because an older savepoint was already restored."
)
write!(f, "Savepoint is invalid or cannot be created.")
}
SavepointError::Storage(storage) => storage.fmt(f),
}
Expand Down Expand Up @@ -420,7 +420,10 @@ pub enum Error {
SimulatedIOFailure,
/// The Database is already open. Cannot acquire lock.
DatabaseAlreadyOpen,
/// This savepoint is invalid because an older savepoint was restored after it was created
/// This savepoint is invalid or cannot be created.
///
/// Savepoints become invalid when an older savepoint is restored after it was created,
/// and savepoints cannot be created if the transaction is "dirty" (any tables have been opened)
InvalidSavepoint,
/// A persistent savepoint exists
PersistentSavepointExists,
Expand Down Expand Up @@ -543,10 +546,7 @@ impl Display for Error {
)
}
Error::InvalidSavepoint => {
write!(
f,
"Savepoint is invalid because an older savepoint was already restored."
)
write!(f, "Savepoint is invalid or cannot be created.")
}
}
}
Expand Down

0 comments on commit 1c137dd

Please sign in to comment.