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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to