[lib.domain] error log when missing docstring

This commit is contained in:
Maxime Alves LIRMM@home 2021-12-01 21:12:19 +01:00
parent 038715e94a
commit a37c2356d6

View File

@ -253,7 +253,12 @@ def domain_schema_dict(m_router: ModuleType) -> Dict:
d_res[path][verb] = {} d_res[path][verb] = {}
d_res[path][verb]['callable'] = f'{m_router.__name__}:{fct.__name__}' d_res[path][verb]['callable'] = f'{m_router.__name__}:{fct.__name__}'
try:
d_res[path][verb]['docs'] = yaml.safe_load(fct.__doc__) d_res[path][verb]['docs'] = yaml.safe_load(fct.__doc__)
except AttributeError:
logger.error(
'Cannot read docstring from fct (fct=%s path=%s verb=%s', fct.__name__, path, verb)
d_res[path][verb]['acls'] = list(map(lambda elt: { **elt, 'acl': elt['acl'].__name__ }, d_res[path][verb]['acls'] = list(map(lambda elt: { **elt, 'acl': elt['acl'].__name__ },
parameters)) parameters))