From e63858659ad453f342a707d07563e12764b14e38 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 28 Aug 2021 23:48:19 +0200 Subject: [PATCH] Fediverse: Better assertionerror messages --- plugins/Fediverse/activitypub.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Fediverse/activitypub.py b/plugins/Fediverse/activitypub.py index edc0ba8d4..78bece3c8 100644 --- a/plugins/Fediverse/activitypub.py +++ b/plugins/Fediverse/activitypub.py @@ -173,7 +173,7 @@ def has_webfinger_support(hostname): def webfinger(hostname, uri): template = _get_webfinger_url(hostname) - assert template + assert template, "missing webfinger url template for %s" % hostname with convert_exceptions(ActorNotFound): content = web.getUrlContent( @@ -280,7 +280,7 @@ def get_actor(localuser, hostname): def get_resource_from_url(url): content = signed_request(url, headers={"Accept": ACTIVITY_MIMETYPE}) - assert content is not None + assert content is not None, "Content from %s is None" % url with convert_exceptions(ActivityPubProtocolError, "Invalid JSON: ", True): return json.loads(content.decode())