diff --git a/src/service/rooms/event_handler/mod.rs b/src/service/rooms/event_handler/mod.rs index d564aa0667ede5b62ed4f3afc1b4e6270a02f000..56b9260e97a140620847988979761d2c2de86f75 100644 --- a/src/service/rooms/event_handler/mod.rs +++ b/src/service/rooms/event_handler/mod.rs @@ -494,7 +494,10 @@ pub async fn upgrade_outlier_to_timeline_pdu( .map_err(|_e| Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed."))?; if !check_result { - return Err(Error::bad_database("Event has failed auth check with state at the event.")); + return Err(Error::BadRequest( + ErrorKind::InvalidParam, + "Event has failed auth check with state at the event.", + )); } debug!("Gathering auth events"); diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs index 62d7ccf86e26ce11a5d8c4e033aed5a7dda313ad..3639c56b1e518171e25d95fe0912f8927048fd2b 100644 --- a/src/service/rooms/timeline/mod.rs +++ b/src/service/rooms/timeline/mod.rs @@ -744,7 +744,7 @@ pub fn create_hash_and_sign_event( ) .map_err(|e| { error!("Auth check failed: {:?}", e); - Error::bad_database("Auth check failed.") + Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed.") })?; if !auth_check {