improvement: log bad database errors automatically

This commit is contained in:
timokoesters 2020-06-11 10:03:08 +02:00
parent 2368a90584
commit 56d4742201
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
13 changed files with 278 additions and 208 deletions

View file

@ -42,7 +42,10 @@ impl<'a, T: Endpoint> FromData<'a> for Ruma<T> {
let data = rocket::try_outcome!(outcome.owned());
let (user_id, device_id) = if T::METADATA.requires_authentication {
let db = request.guard::<State<'_, crate::Database>>().await.expect("database was loaded");
let db = request
.guard::<State<'_, crate::Database>>()
.await
.expect("database was loaded");
// Get token from header or query value
let token = match request