fix: return error when trying to unregister unknown appservice id

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
Matthias Ahouansou 2024-03-31 21:53:03 -04:00 committed by June
parent 51afde9e98
commit 2a48e562e6
2 changed files with 4 additions and 1 deletions

View file

@ -143,7 +143,8 @@ impl Service {
.registration_info
.write()
.await
.remove(service_name);
.remove(service_name)
.ok_or_else(|| crate::Error::AdminCommand("Appservice not found"))?;
self.db.unregister_appservice(service_name)
}

View file

@ -76,6 +76,8 @@ pub enum Error {
RedactionError(OwnedServerName, ruma::canonical_json::RedactionError),
#[error("{0} in {1}")]
InconsistentRoomState(&'static str, ruma::OwnedRoomId),
#[error("{0}")]
AdminCommand(&'static str),
}
impl Error {