add some error handling, mostly to quiet warnings

This commit is contained in:
Jonathan Krebs
2024-12-13 14:55:57 +01:00
committed by Mario Voigt
parent e47da95b41
commit 98fcb9c9a6
7 changed files with 32 additions and 19 deletions

View File

@ -1,5 +1,8 @@
use thiserror::Error;
// for converting a database error into a failed promise
use capnp;
mod raw;
use miette::{Diagnostic, Severity};
@ -79,3 +82,9 @@ impl Diagnostic for Error {
None
}
}
impl From<Error> for capnp::Error {
fn from(dberr: Error) -> capnp::Error {
capnp::Error::failed(format!("database error: {}", dberr.to_string()))
}
}