add error handling for register_appservice too

This commit is contained in:
Torsten Flammiger 2022-01-31 10:07:49 +01:00
parent cc13112592
commit 78502aa6b1
2 changed files with 14 additions and 3 deletions

View file

@ -12,7 +12,7 @@ pub struct Appservice {
}
impl Appservice {
pub fn register_appservice(&self, yaml: serde_yaml::Value) -> Result<()> {
pub fn register_appservice(&self, yaml: serde_yaml::Value) -> Result<Option<String>> {
// TODO: Rumaify
let id = yaml.get("id").unwrap().as_str().unwrap();
self.id_appserviceregistrations.insert(
@ -24,7 +24,7 @@ impl Appservice {
.unwrap()
.insert(id.to_owned(), yaml);
Ok(())
Ok(Some(id.to_owned()))
}
/// Remove an appservice registration