增加依赖提取失败提示,失败时将返回表达式内容

This commit is contained in:
zy7y 2021-03-10 23:02:56 +08:00 committed by Gitee
parent c40a5cc46c
commit 7d973e4492
1 changed files with 2 additions and 2 deletions

View File

@ -28,8 +28,8 @@ def extractor(obj: dict, expr: str = '.') -> object:
try:
result = jsonpath(obj, expr)[0]
except Exception as e:
logger.error(f'提取不到内容,丢给你一个错误!{e}')
result = None
logger.error(f'{expr} - 提取不到内容,丢给你一个错误!{e}')
result = expr
return result