fix: return error when trying to unregister unknown appservice id
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
51afde9e98
commit
2a48e562e6
2 changed files with 4 additions and 1 deletions
|
@ -143,7 +143,8 @@ impl Service {
|
||||||
.registration_info
|
.registration_info
|
||||||
.write()
|
.write()
|
||||||
.await
|
.await
|
||||||
.remove(service_name);
|
.remove(service_name)
|
||||||
|
.ok_or_else(|| crate::Error::AdminCommand("Appservice not found"))?;
|
||||||
|
|
||||||
self.db.unregister_appservice(service_name)
|
self.db.unregister_appservice(service_name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,8 @@ pub enum Error {
|
||||||
RedactionError(OwnedServerName, ruma::canonical_json::RedactionError),
|
RedactionError(OwnedServerName, ruma::canonical_json::RedactionError),
|
||||||
#[error("{0} in {1}")]
|
#[error("{0} in {1}")]
|
||||||
InconsistentRoomState(&'static str, ruma::OwnedRoomId),
|
InconsistentRoomState(&'static str, ruma::OwnedRoomId),
|
||||||
|
#[error("{0}")]
|
||||||
|
AdminCommand(&'static str),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error {
|
impl Error {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue