Document the error module

This commit is contained in:
Charles Chege 2021-10-29 10:40:16 +03:00
parent e4d115b5b0
commit f21492bf60

View File

@ -1,9 +1,15 @@
/// An error from unsuccessful database operations
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
pub enum DbErr { pub enum DbErr {
/// There was a problem with the database connection
Conn(String), Conn(String),
/// An operation did not execute successfully
Exec(String), Exec(String),
/// An error occurred while performing a query
Query(String), Query(String),
/// The record was not found in the database
RecordNotFound(String), RecordNotFound(String),
/// A custom error
Custom(String), 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)] #[derive(Debug, Clone)]
pub struct ColumnFromStrErr(pub String); pub struct ColumnFromStrErr(pub String);