Exception handling for actor

master
Bob Mottram 2019-08-05 22:20:44 +01:00
parent 47aa3fbc1e
commit e868020392
1 changed files with 6 additions and 2 deletions

View File

@ -295,8 +295,12 @@ def personLookup(domain: str,path: str,baseDir: str) -> {}:
if not os.path.isfile(filename): if not os.path.isfile(filename):
return None return None
personJson={"user": "unknown"} personJson={"user": "unknown"}
try:
with open(filename, 'r') as fp: with open(filename, 'r') as fp:
personJson=commentjson.load(fp) personJson=commentjson.load(fp)
except:
print('WARN: Failed to load actor '+filename)
return None
return personJson return personJson
def personBoxJson(baseDir: str,domain: str,port: int,path: str, \ def personBoxJson(baseDir: str,domain: str,port: int,path: str, \