mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-03-14 18:55:37 +00:00
add from_errno construction to Error
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
c6ae6adc80
commit
7045481fae
1 changed files with 4 additions and 0 deletions
|
@ -131,6 +131,10 @@ pub enum Error {
|
|||
}
|
||||
|
||||
impl Error {
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn from_errno() -> Self { Self::Io(std::io::Error::last_os_error()) }
|
||||
|
||||
//#[deprecated]
|
||||
pub fn bad_database(message: &'static str) -> Self {
|
||||
crate::err!(Database(error!("{message}")))
|
||||
|
|
Loading…
Add table
Reference in a new issue