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

bug: Fix metric calls#1462

Open
jrconlin wants to merge 4 commits into
masterfrom
bug/fix-metrics
Open

bug: Fix metric calls#1462
jrconlin wants to merge 4 commits into
masterfrom
bug/fix-metrics

Conversation

@jrconlin

Copy link
Copy Markdown
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 a team and pjenvey June 27, 2022 22:51
Comment thread autopush/router/apnsrouter.py Outdated
try:
reason = e.extra.get("reason", "unknown")
except AttributeError:
reason = format("Unknown: {}", e)

Copy link
Copy Markdown
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.

@pjenvey pjenvey left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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