You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tvalentyn (via GitHub)" <gi...@apache.org> on 2023/07/27 22:33:34 UTC
[GitHub] [beam] tvalentyn commented on a diff in pull request #27722: Return a useful error when we fail to create a MonitoringInfo object
tvalentyn commented on code in PR #27722:
URL: https://github.com/apache/beam/pull/27722#discussion_r1276883314
##########
sdks/python/apache_beam/metrics/monitoring_infos.py:
##########
@@ -299,8 +299,13 @@ def create_monitoring_info(urn, type_urn, payload, labels=None):
payload: The payload field to use in the monitoring info.
labels: The label dictionary to use in the MonitoringInfo.
"""
- return metrics_pb2.MonitoringInfo(
- urn=urn, type=type_urn, labels=labels or {}, payload=payload)
+ try:
+ return metrics_pb2.MonitoringInfo(
+ urn=urn, type=type_urn, labels=labels or {}, payload=payload)
+ except TypeError as e:
+ raise Exception(
Review Comment:
consider ValueError or RuntimeError instead of generic Exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org