From: Felix Ableitner Date: Fri, 5 Feb 2021 16:15:29 +0000 (+0100) Subject: Include object id when logging apub errors X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/hacktivis.me/readmes/README.zh.hant.md?a=commitdiff_plain;h=897263e5a361b57eb8a060053b3a24e1ce88ea74;p=lemmy.git Include object id when logging apub errors --- diff --git a/crates/apub/src/lib.rs b/crates/apub/src/lib.rs index 9a9507eb..0b3fee43 100644 --- a/crates/apub/src/lib.rs +++ b/crates/apub/src/lib.rs @@ -80,11 +80,11 @@ fn check_is_apub_id_valid(apub_id: &Url) -> Result<(), LemmyError> { let host = apub_id.host_str().context(location_info!())?; let host_as_ip = host.parse::(); if host == "localhost" || host_as_ip.is_ok() { - return Err(anyhow!("invalid hostname: {:?}", host).into()); + return Err(anyhow!("invalid hostname {}: {}", host, apub_id).into()); } if apub_id.scheme() != Settings::get().get_protocol_string() { - return Err(anyhow!("invalid apub id scheme: {:?}", apub_id.scheme()).into()); + return Err(anyhow!("invalid apub id scheme {}: {}", apub_id.scheme(), apub_id).into()); } let mut allowed_instances = Settings::get().get_allowed_instances();