Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve exception handling a bit #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vladimir-smirnov-sociomantic
Copy link
Contributor

Make it narower, cause try-except block is too wide for some cases

Make it narower, cause try-except block is too wide for some cases
logger.debug(caller="fetch()", msg="COULDN'T READ POINTS. SETTING TO EMPTY LIST", debug_key=self.path)
known_points = []
except Exception as e:
logger.debug(caller="fetch()", msg="UNKNOWN EXCEPTION WHILE READING POINTS: %s" % e, debug_key=self.path)
known_points = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only 2 possible exceptions here are KeyError and IndexError, and both mean that influxdb didn't return the data. I don't see the point of having two except cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll change it to "except (KeyError, IndexError)"

@Dieterbe
Copy link
Contributor

Dieterbe commented Feb 3, 2015

does still apply to current master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants