splunklib.binding.HTTPlib.request improper exception handling.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- Python
- Stars
- 743
- Forks
- 387
- Avg merge
- 42m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from splunk/splunk-sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
splunk/splunk-sdk-python#835 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
splunk/splunk-sdk-python#831 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
splunk/splunk-sdk-python#704 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
splunk/splunk-sdk-python#840 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
splunk/splunk-sdk-python#828 ·
All issues in splunk/splunk-sdk-python
Similar issues
-
bug ci good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
documentation
Difficulty 2/5 Half a day Newbie friendliness 62/100
inmanta/inmanta-core#10835 ·
-
sponsored
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Diaoul/subliminal#1382 ·