Skip to content

Commit

Permalink
Implement std::Error for all error enums
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed May 30, 2023
1 parent ccf9f06 commit 2d1e015
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ impl Display for StorageError {
}
}

impl std::error::Error for StorageError {}

/// Errors related to opening tables
#[derive(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -186,6 +188,8 @@ impl Display for TableError {
}
}

impl std::error::Error for TableError {}

/// Errors related to opening a database
#[derive(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -234,6 +238,8 @@ impl Display for DatabaseError {
}
}

impl std::error::Error for DatabaseError {}

/// Errors related to savepoints
#[derive(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -273,6 +279,8 @@ impl Display for SavepointError {
}
}

impl std::error::Error for SavepointError {}

/// Errors related to compaction
#[derive(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -312,6 +320,8 @@ impl Display for CompactionError {
}
}

impl std::error::Error for CompactionError {}

/// Errors related to transactions
#[derive(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -350,6 +360,8 @@ impl Display for TransactionError {
}
}

impl std::error::Error for TransactionError {}

/// Errors related to committing transactions
#[derive(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -388,6 +400,8 @@ impl Display for CommitError {
}
}

impl std::error::Error for CommitError {}

/// Superset of all other errors that can occur. Convenience enum so that users can convert all errors into a single type
#[derive(Debug)]
#[non_exhaustive]
Expand Down

0 comments on commit 2d1e015

Please sign in to comment.