HttpRequest,
HttpResponse,
};
-use anyhow::Context;
+use anyhow::{anyhow, Context};
use futures::StreamExt;
use http::StatusCode;
use lemmy_api_common::blocking;
let activity_domain = id.domain().context(location_info!())?;
if activity_domain == hostname {
- let error = LemmyError::from(anyhow::anyhow!(
+ let err = anyhow!(
"Error: received activity which was sent by local instance: {:?}",
id
+ );
+ return Err(LemmyError::from_error_message(
+ err,
+ "received_local_activity",
));
- return Err(error.with_message("received_local_activity"));
}
Ok(())
}