refactor Error::bad_config

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-12 07:41:01 +00:00
parent 93ec4e579b
commit 4cc92dd175
10 changed files with 71 additions and 66 deletions

View file

@ -1,5 +1,6 @@
use std::{fmt::Debug, mem};
use conduit::Err;
use http::{header::AUTHORIZATION, HeaderValue};
use ipaddress::IPAddress;
use reqwest::{Client, Method, Request, Response, Url};
@ -26,7 +27,7 @@ where
T: OutgoingRequest + Debug + Send,
{
if !services().globals.allow_federation() {
return Err(Error::bad_config("Federation is disabled."));
return Err!(Config("allow_federation", "Federation is disabled."));
}
let actual = resolve::get_actual_dest(dest).await?;