Skip to content

Commit 2bbf6ff

Browse files
fix: properly handle error types in context manager
1 parent 189bfde commit 2bbf6ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/uipath/runtime/context.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from uipath.core.tracing import UiPathTraceManager
1313

1414
from uipath.runtime.errors import (
15+
UiPathBaseRuntimeError,
1516
UiPathErrorCategory,
1617
UiPathErrorCode,
1718
UiPathErrorContract,
@@ -200,14 +201,14 @@ def __exit__(self, exc_type, exc_val, exc_tb):
200201
if self.result is None:
201202
self.result = UiPathRuntimeResult()
202203

203-
if exc_type:
204+
if exc_type and exc_val:
204205
# Create error info from exception
205-
match exc_type:
206+
match exc_val:
206207
case UiPathFaultedTriggerError():
207208
error_info = UiPathRuntimeError.from_resume_trigger_error(
208209
exc_type
209210
).error_info
210-
case UiPathRuntimeError():
211+
case UiPathBaseRuntimeError():
211212
error_info = exc_val.error_info
212213
case _:
213214
# Generic error

0 commit comments

Comments
 (0)