splunklib.binding.HTTPlib.request improper exception handling.
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- Python
- Estrellas
- 743
- Forks
- 387
- Merge medio
- 42 min
- PR fusionados (30 d)
- 4
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de splunk/splunk-sdk-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
splunk/splunk-sdk-python#835 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
splunk/splunk-sdk-python#831 · 1 comentario ·
-
Unverified SSL context Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
splunk/splunk-sdk-python#704 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
splunk/splunk-sdk-python#840 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
splunk/splunk-sdk-python#828 ·
Todos los issues de splunk/splunk-sdk-python
Issues similares
-
documentation help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
simonw/sqlite-utils#872 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100