Skip to content

Commit 2d4a4f3

Browse files
fix: properly handle error types in context manager (#79)
* fix: properly handle error types in context manager * chore: bump version
1 parent 189bfde commit 2d4a4f3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-runtime"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

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

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)