fix: propogate errors to cas [JAR-9409, JAR-9415]#98
fix: propogate errors to cas [JAR-9409, JAR-9415]#98andrewwan-uipath wants to merge 1 commit intomainfrom
Conversation
d0134ae to
d3bc12d
Compare
|
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. |
|
Thanks @andrewwan-uipath. Feel free to make a ticket for the max-steps as well with label bugbash |
6182e6c to
073714d
Compare
oh actually, I did some more digging and we do have max iterations |
src/uipath/runtime/chat/runtime.py
Outdated
| """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 |
There was a problem hiding this comment.
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
fa608c1 to
4f4730b
Compare
src/uipath/runtime/chat/protocol.py
Outdated
| """Send an exchange end event.""" | ||
| ... | ||
|
|
||
| async def emit_exchange_error_event( |
There was a problem hiding this comment.
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
4f4730b to
a145910
Compare
a145910 to
06b2335
Compare
pyproject.toml
Outdated
| [project] | ||
| name = "uipath-runtime" | ||
| version = "0.9.3" | ||
| version = "0.9.4" |
There was a problem hiding this comment.
you need to increment the major version 0.10.0 (adding a new protocol method is a breaking change)
06b2335 to
0dab307
Compare
0dab307 to
a4bceb7
Compare
https://uipath.atlassian.net/browse/JAR-9409
https://uipath.atlassian.net/browse/JAR-9415
Related to this PR: UiPath/uipath-python#1421