add from_errno construction to Error

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-18 21:58:49 +00:00
parent c6ae6adc80
commit 7045481fae

View file

@ -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}")))