Skip to content

Commit

Permalink
Only try to record real exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Jul 27, 2023
1 parent dccb463 commit 81a92ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qcodes/dataset/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ def __exit__(
f"{self.ds.guid};\nTraceback:\n{exception_string}"
)
self._span.set_status(trace.Status(trace.StatusCode.ERROR))
self._span.record_exception(exception_value)
if isinstance(exception_value, Exception):
self._span.record_exception(exception_value)
self.ds.add_metadata("measurement_exception", exception_string)

# and finally mark the dataset as closed, thus
Expand Down

0 comments on commit 81a92ee

Please sign in to comment.