Macroize various remaining Error constructions.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-04-26 23:50:03 +00:00
parent 130f61d409
commit 72fd072026
8 changed files with 58 additions and 110 deletions

View File

@@ -1,7 +1,7 @@
use axum::extract::State;
use futures::StreamExt;
use ruma::api::client::{error::ErrorKind, room::aliases};
use tuwunel_core::{Error, Result};
use ruma::api::client::room::aliases;
use tuwunel_core::{Err, Result};
use crate::Ruma;
@@ -23,10 +23,7 @@ pub(crate) async fn get_room_aliases_route(
.user_can_see_state_events(sender_user, &body.room_id)
.await
{
return Err(Error::BadRequest(
ErrorKind::forbidden(),
"You don't have permission to view this room.",
));
return Err!(Request(Forbidden("You don't have permission to view this room.",)));
}
Ok(aliases::v3::Response {