Browse Source

fix: return error when trying to unregister unknown appservice id

unstable-msc4125
Matthias Ahouansou 2 years ago
parent
commit
11612e347d
No known key found for this signature in database
  1. 3
      src/service/appservice/mod.rs
  2. 2
      src/utils/error.rs

3
src/service/appservice/mod.rs

@ -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)
}

2
src/utils/error.rs

@ -85,6 +85,8 @@ pub enum Error {
#[cfg(feature = "conduit_bin")]
#[error("{0}")]
PathError(#[from] axum::extract::rejection::PathRejection),
#[error("{0}")]
AdminCommand(&'static str),
}
impl Error {

Loading…
Cancel
Save