From f21492bf6067543b8714486fbbe9c1382477ffae Mon Sep 17 00:00:00 2001 From: Charles Chege Date: Fri, 29 Oct 2021 10:40:16 +0300 Subject: [PATCH] Document the error module --- src/error.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/error.rs b/src/error.rs index f39aee72..f8412c05 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,9 +1,15 @@ +/// An error from unsuccessful database operations #[derive(Debug, PartialEq)] pub enum DbErr { + /// There was a problem with the database connection Conn(String), + /// An operation did not execute successfully Exec(String), + /// An error occurred while performing a query Query(String), + /// The record was not found in the database RecordNotFound(String), + /// A custom error Custom(String), } @@ -21,6 +27,7 @@ impl std::fmt::Display for DbErr { } } +/// An error from a failed column operation when trying to convert the column to a string #[derive(Debug, Clone)] pub struct ColumnFromStrErr(pub String);