Skip to content

fix: propogate errors to cas [JAR-9409, JAR-9415]#98

Open
andrewwan-uipath wants to merge 1 commit intomainfrom
feat/propogate-cas-errors
Open

fix: propogate errors to cas [JAR-9409, JAR-9415]#98
andrewwan-uipath wants to merge 1 commit intomainfrom
feat/propogate-cas-errors

Conversation

@andrewwan-uipath
Copy link

@andrewwan-uipath andrewwan-uipath commented Mar 6, 2026

@maxduu
Copy link
Contributor

maxduu commented Mar 16, 2026

Nice, what does licensing errors look like on UI? Does it match the Temporal behavior?

Also, we've been using error-ids here and we should port them over if possible? This way our frontend can look at the error-id and render things consistently between Temporal / UR backends. If you could look at the current error-ids we emit and check if their usages can be ported over for UR, would be great.

@andrewwan-uipath
Copy link
Author

Nice, what does licensing errors look like on UI? Does it match the Temporal behavior?

Also, we've been using error-ids here and we should port them over if possible? This way our frontend can look at the error-id and render things consistently between Temporal / UR backends. If you could look at the current error-ids we emit and check if their usages can be ported over for UR, would be great.

Looks like we might need to make some code changes in uipath-langchain. It doesn't handle errors correctly it seems like. Currently it will just show the raw error messages. We should be able to port over the errors id except for the max steps reached one. Doesn't seem like we have that logic implemented.

@maxduu
Copy link
Contributor

maxduu commented Mar 17, 2026

Thanks @andrewwan-uipath. Feel free to make a ticket for the max-steps as well with label bugbash

@andrewwan-uipath andrewwan-uipath force-pushed the feat/propogate-cas-errors branch 3 times, most recently from 6182e6c to 073714d Compare March 18, 2026 05:45
@andrewwan-uipath
Copy link
Author

Thanks @andrewwan-uipath. Feel free to make a ticket for the max-steps as well with label bugbash

oh actually, I did some more digging and we do have max iterations

"""Extract error_id and user-facing message from an exception."""
if isinstance(e, UiPathBaseRuntimeError):
return _extract_error_from_contract(e.error_info)
return CASErrorId.DEFAULT_ERROR, _DEFAULT_ERROR_MESSAGE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These mappings (CAS-specific protocol concerns) should be a part of uipath-python (chat bridge protocol implementation).

Use this layer to catch exceptions and emit error events, and then map the errors with CAS specific logic/error codes here https://github.com/UiPath/uipath-python/blob/main/packages/uipath/src/uipath/_cli/_chat/_bridge.py#L28

@andrewwan-uipath andrewwan-uipath force-pushed the feat/propogate-cas-errors branch 2 times, most recently from fa608c1 to 4f4730b Compare March 18, 2026 08:12
"""Send an exchange end event."""
...

async def emit_exchange_error_event(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change the signature to accept an Exception directly instead of decomposed primitives: error_id and message are always derived from an exception at the call site anyway. Just let the protocol implementation decide what to do with the exception.

We have other apps that use these contracts, that might want to handle this differently

@andrewwan-uipath andrewwan-uipath force-pushed the feat/propogate-cas-errors branch from 4f4730b to a145910 Compare March 19, 2026 07:56
@radu-mocanu radu-mocanu force-pushed the feat/propogate-cas-errors branch from a145910 to 06b2335 Compare March 19, 2026 07:59
pyproject.toml Outdated
[project]
name = "uipath-runtime"
version = "0.9.3"
version = "0.9.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to increment the major version 0.10.0 (adding a new protocol method is a breaking change)

@andrewwan-uipath andrewwan-uipath force-pushed the feat/propogate-cas-errors branch from 06b2335 to 0dab307 Compare March 19, 2026 08:08
@radu-mocanu radu-mocanu force-pushed the feat/propogate-cas-errors branch from 0dab307 to a4bceb7 Compare March 19, 2026 08:55
@andrewwan-uipath andrewwan-uipath changed the title fix: propogate errors to cas [JAR-9409, JAR-9330] fix: propogate errors to cas [JAR-9409, JAR-9415] Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants