Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

bug: Fix metric calls #1462

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

bug: Fix metric calls #1462

wants to merge 4 commits into from

Conversation

jrconlin
Copy link
Member

  • Be explicit about args
  • handle AttributeError gracefully

Closes: #CONSVC-1842

* Be explicit about args
* handle AttributeError gracefully

Closes: #CONSVC-1842
@jrconlin jrconlin requested review from pjenvey and a team June 27, 2022 22:51
try:
reason = e.extra.get("reason", "unknown")
except AttributeError:
reason = format("Unknown: {}", e)
Copy link
Member

Choose a reason for hiding this comment

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

reason here is a metrics tag value which shouldn't have whitespace:

Suggested change
reason = format("Unknown: {}", e)
reason = "unknown"

Sentry's complaining about a hyper.common.exceptions.ConnectionResetError, could include it alongside ConnectionError handling above -- if isinstance(e, (ConnectionError, ConnectionResetError)): but probably not even worth the effort.

Copy link
Member

@pjenvey pjenvey left a comment

Choose a reason for hiding this comment

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

The last update removed the fix for the AttributeError entirely

@jrconlin
Copy link
Member Author

I hate "helpful" merges.

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

Successfully merging this pull request may close these issues.

2 participants