refactor: better error handling

This commit is contained in:
timokoesters 2020-06-09 15:13:17 +02:00
parent 80935c5826
commit 2368a90584
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
15 changed files with 2062 additions and 1909 deletions

View file

@ -12,7 +12,7 @@ mod utils;
pub use database::Database;
pub use error::{Error, Result};
pub use pdu::PduEvent;
pub use ruma_wrapper::{MatrixResult, Ruma};
pub use ruma_wrapper::{ConduitResult, Ruma, RumaResponse};
use rocket::{fairing::AdHoc, routes};
@ -95,7 +95,7 @@ fn setup_rocket() -> rocket::Rocket {
],
)
.attach(AdHoc::on_attach("Config", |rocket| {
let data = Database::load_or_create(&rocket.config());
let data = Database::load_or_create(&rocket.config()).expect("valid config");
Ok(rocket.manage(data))
}))