splunklib.binding.HTTPlib.request improper exception handling.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start at splunklib.binding.HTTPlib.request around line 1345 and inspect the definition of HTTPError and the retry loop. Confirm the intended behavior for responses with status 400 or greater, then add or update coverage to verify that the intended exception is raised without the generic BaseException error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Each time an HTTP request is made, splunklib checks the if the response code 400 or greater (line 1345).
If the response code is 400 <= then an exception is raised by calling the HTTPError(). HTTPError has no return, so a generic Python error message of BaseException.with_traceback() takes exactly one argument (0 given)
Testing has shown that replacing "raise HTTPError(response)" with "raise None" results in the same outcome.
Possibly removing the "raise" and just call the function on its own will fix this, but I'm unsure what the intended effect was suppose to be.
CODE SNIPPET
while True:
try:
response = self.handler(url, message, **kwargs)
break
except Exception:
if self.retries <= 0:
raise
else:
time.sleep(self.retryDelay)
self.retries -= 1
response = record(response)
if 400 <= response.status:
raise HTTPError(response)
- Ngôn ngữ chính
- Python
- Star
- 743
- Fork
- 387
- Merge trung bình
- 42 phút
- Pull request đã merge (30 ngày)
- 4
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của splunk/splunk-sdk-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
splunk/splunk-sdk-python#835 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
splunk/splunk-sdk-python#831 · 1 bình luận ·
-
Unverified SSL context Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
splunk/splunk-sdk-python#704 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
splunk/splunk-sdk-python#840 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
splunk/splunk-sdk-python#828 ·
Tất cả issue của splunk/splunk-sdk-python
Issue tương tự
-
link-check link-check:sphinx-theme
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
OpenHands/extensions#626 · 1 bình luận ·
-
Change observation tooltip text Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
CSCfi/sd-search-api#39 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100