mirror of https://gitlab.com/bashrc2/epicyon
Handle errors returned from webfinger
parent
335a35b84e
commit
13a16bec18
|
@ -883,6 +883,10 @@ if args.actor:
|
|||
print('Unable to webfinger '+nickname+'@'+domain)
|
||||
sys.exit()
|
||||
|
||||
if wfRequest.get('errors'):
|
||||
print('wfRequest error: '+str(wfRequest['errors']))
|
||||
sys.exit()
|
||||
|
||||
asHeader = {'Accept': 'application/activity+json; profile="https://www.w3.org/ns/activitystreams"'}
|
||||
personUrl = getUserUrl(wfRequest)
|
||||
if nickname==domain:
|
||||
|
|
8
posts.py
8
posts.py
|
@ -1343,6 +1343,11 @@ def sendSignedJson(postJsonObject: {},session,baseDir: str, \
|
|||
print('DEBUG: webfinger for '+handle+' failed')
|
||||
return 1
|
||||
|
||||
if wfRequest.get('errors'):
|
||||
if debug:
|
||||
print('DEBUG: webfinger for '+handle+' failed with errors '+str(wfRequest))
|
||||
return 1
|
||||
|
||||
if not clientToServer:
|
||||
postToBox='inbox'
|
||||
else:
|
||||
|
@ -1596,7 +1601,8 @@ def hasSharedInbox(session,httpPrefix: str,domain: str) -> bool:
|
|||
wfRequest=webfingerHandle(session,domain+'@'+domain,httpPrefix,{}, \
|
||||
None,__version__)
|
||||
if wfRequest:
|
||||
return True
|
||||
if not wfRequest.get('errors'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def sendToFollowers(session,baseDir: str, \
|
||||
|
|
Loading…
Reference in New Issue