mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 19:14:09 +01:00
Fediverse: Better assertionerror messages
This commit is contained in:
parent
52a5cefd50
commit
e63858659a
@ -173,7 +173,7 @@ def has_webfinger_support(hostname):
|
|||||||
|
|
||||||
def webfinger(hostname, uri):
|
def webfinger(hostname, uri):
|
||||||
template = _get_webfinger_url(hostname)
|
template = _get_webfinger_url(hostname)
|
||||||
assert template
|
assert template, "missing webfinger url template for %s" % hostname
|
||||||
|
|
||||||
with convert_exceptions(ActorNotFound):
|
with convert_exceptions(ActorNotFound):
|
||||||
content = web.getUrlContent(
|
content = web.getUrlContent(
|
||||||
@ -280,7 +280,7 @@ def get_actor(localuser, hostname):
|
|||||||
def get_resource_from_url(url):
|
def get_resource_from_url(url):
|
||||||
content = signed_request(url, headers={"Accept": ACTIVITY_MIMETYPE})
|
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):
|
with convert_exceptions(ActivityPubProtocolError, "Invalid JSON: ", True):
|
||||||
return json.loads(content.decode())
|
return json.loads(content.decode())
|
||||||
|
Loading…
Reference in New Issue
Block a user