Skip to content

Commit e5bb939

Browse files
pvaneckCopilot
andauthored
Update sdk/core/azure-core/azure/core/tracing/opentelemetry.py
Co-authored-by: Copilot <[email protected]>
1 parent e63f6f6 commit e5bb939

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sdk/core/azure-core/azure/core/tracing/opentelemetry.py

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def set_span_status(span: Span, status: str, description: Optional[str] = None)
174174
:type description: str
175175
"""
176176
status = status.upper()
177+
if description is not None and status != "ERROR":
178+
raise ValueError("Description is only valid when status is 'ERROR'.")
177179
if status == "OK":
178180
span.set_status(StatusCode.OK)
179181
elif status == "ERROR":

0 commit comments

Comments
 (0)