mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-12-27 13:14:28 +01:00
Merge branch 'unregister-fail-id-not-found' into 'next'
fix: return error when trying to unregister unknown appservice id See merge request famedly/conduit!610
This commit is contained in:
commit
cf1e7bc1ed
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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,8 @@ pub enum Error {
|
||||||
#[cfg(feature = "conduit_bin")]
|
#[cfg(feature = "conduit_bin")]
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
PathError(#[from] axum::extract::rejection::PathRejection),
|
PathError(#[from] axum::extract::rejection::PathRejection),
|
||||||
|
#[error("{0}")]
|
||||||
|
AdminCommand(&'static str),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error {
|
impl Error {
|
||||||
|
|
Loading…
Reference in a new issue