change: capture exception with sentry

This commit is contained in:
debugtalk
2020-06-04 12:11:27 +08:00
parent dd61c437de
commit 1d0df3881f
7 changed files with 31 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ from typing import Text, List, Tuple, Dict, Set, NoReturn
import jinja2
from loguru import logger
from sentry_sdk import capture_exception
from httprunner import exceptions, __version__
from httprunner.compat import ensure_testcase_v3_api, ensure_testcase_v3
@@ -131,6 +132,7 @@ def format_pytest_with_black(*python_paths: Text) -> NoReturn:
try:
subprocess.run(["black", *python_paths])
except subprocess.CalledProcessError as ex:
capture_exception(ex)
logger.error(ex)