mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-08 22:13:13 +08:00
change: do not capture exception for json loads
This commit is contained in:
@@ -11,7 +11,6 @@ from requests.exceptions import (
|
|||||||
MissingSchema,
|
MissingSchema,
|
||||||
RequestException,
|
RequestException,
|
||||||
)
|
)
|
||||||
from sentry_sdk import capture_exception
|
|
||||||
|
|
||||||
from httprunner.models import RequestData, ResponseData
|
from httprunner.models import RequestData, ResponseData
|
||||||
from httprunner.models import SessionData, ReqRespData
|
from httprunner.models import SessionData, ReqRespData
|
||||||
@@ -51,12 +50,12 @@ def get_req_resp_record(resp_obj: Response) -> ReqRespData:
|
|||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
# str: a=1&b=2
|
# str: a=1&b=2
|
||||||
pass
|
pass
|
||||||
except UnicodeDecodeError as ex:
|
except UnicodeDecodeError:
|
||||||
# bytes/bytearray: request body in protobuf
|
# bytes/bytearray: request body in protobuf
|
||||||
capture_exception(ex)
|
pass
|
||||||
except TypeError as ex:
|
except TypeError:
|
||||||
# neither str nor bytes/bytearray, e.g. <MultipartEncoder>
|
# neither str nor bytes/bytearray, e.g. <MultipartEncoder>
|
||||||
capture_exception(ex)
|
pass
|
||||||
|
|
||||||
request_content_type = lower_dict_keys(request_headers).get("content-type")
|
request_content_type = lower_dict_keys(request_headers).get("content-type")
|
||||||
if request_content_type and "multipart/form-data" in request_content_type:
|
if request_content_type and "multipart/form-data" in request_content_type:
|
||||||
|
|||||||
Reference in New Issue
Block a user