]> Untitled Git - lemmy.git/blobdiff - crates/api/src/site.rs
Rework error handling (fixes #1714) (#2135)
[lemmy.git] / crates / api / src / site.rs
index eab15a77b254a80debe7ae9d6ef5f751e8c9e206..e978569905b450045388567190304e7b83947376 100644 (file)
@@ -416,11 +416,9 @@ impl Perform for ResolveObject {
 
     let res = search_by_apub_id(&self.q, context)
       .await
-      .map_err(LemmyError::from)
       .map_err(|e| e.with_message("couldnt_find_object"))?;
     convert_response(res, local_user_view.map(|l| l.person.id), context.pool())
       .await
-      .map_err(LemmyError::from)
       .map_err(|e| e.with_message("couldnt_find_object"))
   }
 }
@@ -565,7 +563,6 @@ impl Perform for SaveSiteConfig {
 
     // Make sure docker doesn't have :ro at the end of the volume, so its not a read-only filesystem
     let config_hjson = Settings::save_config_file(&data.config_hjson)
-      .map_err(LemmyError::from)
       .map_err(|e| e.with_message("couldnt_update_site"))?;
 
     Ok(GetSiteConfigResponse { config_hjson })