1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-08-04 11:43:58 +00:00

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 committed by Jade Ellis
parent 21bbee8e3c
commit 667afedd24
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
9 changed files with 78 additions and 125 deletions

View file

@ -1,12 +1,11 @@
use std::collections::{BTreeMap, HashMap, hash_map};
use conduwuit::{
Err, Error, PduEvent, Result, debug, debug_info, err, implement, state_res, trace, warn,
Err, PduEvent, Result, debug, debug_info, err, implement, state_res, trace, warn,
};
use futures::future::ready;
use ruma::{
CanonicalJsonObject, CanonicalJsonValue, EventId, RoomId, ServerName,
api::client::error::ErrorKind, events::StateEventType,
CanonicalJsonObject, CanonicalJsonValue, EventId, RoomId, ServerName, events::StateEventType,
};
use super::{check_room_id, get_room_version_id, to_room_version};
@ -110,10 +109,9 @@ pub(super) async fn handle_outlier_pdu<'a>(
v.insert(auth_event);
},
| hash_map::Entry::Occupied(_) => {
return Err(Error::BadRequest(
ErrorKind::InvalidParam,
return Err!(Request(InvalidParam(
"Auth event's type and state_key combination exists multiple times.",
));
)));
},
}
}