Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

InfluxDBClient.request discards error details when raising exception #533

@thomir

Description

@thomir

The InfluxDBClient.request method contains code to make a request to the influxdb server that looks like this:

    while retry:
            try:
                response = self._session.request(...)
                break
            except requests.exceptions.ConnectionError as e:
                _try += 1
                if self._retries != 0:
                    retry = _try < self._retries
        else:
            raise requests.exceptions.ConnectionError

The problem is that if we fail to connect, the ConnectionError that is raised does not have any of the information about what actually failed, making it really hard to debug from the exception message.

A possibly alternative might be something like this:

    while retry:
            try:
                response = self._session.request(...)
                break
            except requests.exceptions.ConnectionError as e:
                _try += 1
                if self._retries != 0:
                    retry = _try < self._retries
                if not retry:
                    raise

This will re-raise the exception that caused the failure, with the contextual information about what actually happened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy