forked from DxvLwRYF/apiAutoTest
增加自定义函数报错的异常处理
This commit is contained in:
parent
7d973e4492
commit
3b3599b246
|
@ -45,8 +45,11 @@ def rep_expr(content: str, data: dict, expr: str = '&(.*?)&') -> str:
|
|||
|
||||
# 增加自定义函数得的调用,函数写在tools/hooks.py中
|
||||
for func in re.findall('@(.*?)@', content):
|
||||
content = content.replace(f'@{func}@', exec_func(func))
|
||||
|
||||
try:
|
||||
content = content.replace(f'@{func}@', exec_func(func))
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
continue
|
||||
return content
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue