arpakitlib 1.8.93__py3-none-any.whl → 1.8.95__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arpakitlib/ar_http_request_util.py +41 -2
- {arpakitlib-1.8.93.dist-info → arpakitlib-1.8.95.dist-info}/METADATA +1 -1
- {arpakitlib-1.8.93.dist-info → arpakitlib-1.8.95.dist-info}/RECORD +6 -6
- {arpakitlib-1.8.93.dist-info → arpakitlib-1.8.95.dist-info}/WHEEL +1 -1
- {arpakitlib-1.8.93.dist-info → arpakitlib-1.8.95.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.93.dist-info → arpakitlib-1.8.95.dist-info}/entry_points.txt +0 -0
@@ -9,6 +9,7 @@ import aiohttp
|
|
9
9
|
import requests
|
10
10
|
from aiohttp_socks import ProxyConnector
|
11
11
|
|
12
|
+
from arpakitlib.ar_json_util import transfer_data_to_json_str
|
12
13
|
from arpakitlib.ar_sleep_util import sync_safe_sleep, async_safe_sleep
|
13
14
|
from arpakitlib.ar_type_util import raise_for_type
|
14
15
|
|
@@ -66,7 +67,26 @@ def sync_make_http_request(
|
|
66
67
|
if enable_logging_:
|
67
68
|
_logger.info(f"ignored status {response.status_code} {method} {url} {params}")
|
68
69
|
else:
|
69
|
-
|
70
|
+
try:
|
71
|
+
response.raise_for_status()
|
72
|
+
except requests.HTTPError as raise_for_status_exception:
|
73
|
+
if enable_logging_:
|
74
|
+
try:
|
75
|
+
json_data = response.json()
|
76
|
+
_logger.error(
|
77
|
+
f"bad status {method} {url} {params}"
|
78
|
+
f"{transfer_data_to_json_str(data=json_data, beautify=True)}"
|
79
|
+
)
|
80
|
+
except Exception:
|
81
|
+
try:
|
82
|
+
text = response.text
|
83
|
+
_logger.error(
|
84
|
+
f"bad status {method} {url} {params}"
|
85
|
+
f"{text}"
|
86
|
+
)
|
87
|
+
except Exception:
|
88
|
+
pass
|
89
|
+
raise raise_for_status_exception
|
70
90
|
if enable_logging_:
|
71
91
|
_logger.info(f"good try http {method} {url} {params}")
|
72
92
|
return response
|
@@ -131,7 +151,26 @@ async def async_make_http_request(
|
|
131
151
|
f"ignored status {response.status} {method} {url} {params}"
|
132
152
|
)
|
133
153
|
else:
|
134
|
-
|
154
|
+
try:
|
155
|
+
response.raise_for_status()
|
156
|
+
except aiohttp.ClientResponseError as raise_for_status_exception:
|
157
|
+
if enable_logging_:
|
158
|
+
try:
|
159
|
+
json_data = await response.json()
|
160
|
+
_logger.error(
|
161
|
+
f"bad status {method} {url} {params}"
|
162
|
+
f"{transfer_data_to_json_str(data=json_data, beautify=True)}"
|
163
|
+
)
|
164
|
+
except Exception:
|
165
|
+
try:
|
166
|
+
text = await response.text()
|
167
|
+
_logger.error(
|
168
|
+
f"bad status {method} {url} {params}"
|
169
|
+
f"{text}"
|
170
|
+
)
|
171
|
+
except Exception:
|
172
|
+
pass
|
173
|
+
raise raise_for_status_exception
|
135
174
|
await response.read()
|
136
175
|
if enable_logging_:
|
137
176
|
_logger.info(f"good try {method} {url} {params}")
|
@@ -359,7 +359,7 @@ arpakitlib/ar_file_storage_in_dir_util.py,sha256=Zh922S6-aIy0p_Fen8GTTrGpixpPQ6c
|
|
359
359
|
arpakitlib/ar_file_util.py,sha256=GUdJYm1tUZnYpY-SIPRHAZBHGra8NKy1eYEI0D5AfhY,489
|
360
360
|
arpakitlib/ar_func_util.py,sha256=lG0bx_DtxWN4skbUim0liRZ6WUyLVV8Qfk6iZNtCZOs,1042
|
361
361
|
arpakitlib/ar_hash_util.py,sha256=Iqy6KBAOLBQMFLWv676boI5sV7atT2B-fb7aCdHOmIQ,340
|
362
|
-
arpakitlib/ar_http_request_util.py,sha256=
|
362
|
+
arpakitlib/ar_http_request_util.py,sha256=PCUtGOQIvNScrLqD_9Z8LqT-7a-lP2y-Y-CH5vGdn7Q,7663
|
363
363
|
arpakitlib/ar_ip_util.py,sha256=aEAa1Hvobh9DWX7cmBAPLqnXSTiKe2hRk-WJaiKMaI8,1009
|
364
364
|
arpakitlib/ar_json_db_util.py,sha256=5nELpAY1_5_iTN4nMcutQtJQ5Nt52-xiKELxEH65RkY,7240
|
365
365
|
arpakitlib/ar_json_util.py,sha256=jnVfpQ6QSDq8NgIlh_6ZzXDveOiybr7QSQkXutE7d2s,2676
|
@@ -384,8 +384,8 @@ arpakitlib/ar_ssh_runner_util.py,sha256=yvAwza480MkHKvLkDEsR7JNh2bYNs6P9rCVo4NA8
|
|
384
384
|
arpakitlib/ar_str_util.py,sha256=CAv0wH8nP5Ja59S-hEdmNhNrM_Fwy935d0zntLpJkx8,4309
|
385
385
|
arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
|
386
386
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
387
|
-
arpakitlib-1.8.
|
388
|
-
arpakitlib-1.8.
|
389
|
-
arpakitlib-1.8.
|
390
|
-
arpakitlib-1.8.
|
391
|
-
arpakitlib-1.8.
|
387
|
+
arpakitlib-1.8.95.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
388
|
+
arpakitlib-1.8.95.dist-info/METADATA,sha256=ywFYfHMbc008xqOHZabOFBrwzUqm_Tx4hE86sxyIF5c,3517
|
389
|
+
arpakitlib-1.8.95.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
390
|
+
arpakitlib-1.8.95.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
391
|
+
arpakitlib-1.8.95.dist-info/RECORD,,
|
File without changes
|
File without changes
|