Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify InvalidSavepoint meaning #705

Merged
merged 1 commit into from
Oct 15, 2023
Merged
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
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
Loading