Skip to content

Commit e638586

Browse files
committed
Fediverse: Better assertionerror messages
1 parent 52a5cef commit e638586

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/Fediverse/activitypub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def has_webfinger_support(hostname):
173173

174174
def webfinger(hostname, uri):
175175
template = _get_webfinger_url(hostname)
176-
assert template
176+
assert template, "missing webfinger url template for %s" % hostname
177177

178178
with convert_exceptions(ActorNotFound):
179179
content = web.getUrlContent(
@@ -280,7 +280,7 @@ def get_actor(localuser, hostname):
280280
def get_resource_from_url(url):
281281
content = signed_request(url, headers={"Accept": ACTIVITY_MIMETYPE})
282282

283-
assert content is not None
283+
assert content is not None, "Content from %s is None" % url
284284

285285
with convert_exceptions(ActivityPubProtocolError, "Invalid JSON: ", True):
286286
return json.loads(content.decode())

0 commit comments

Comments
 (0)