Skip to content

Commit e6f0da6

Browse files
authored
Merge pull request #144 from UiPath/feature/license_error
feat(err_license): handle License not Available err
2 parents 4ec9c1c + 199d63a commit e6f0da6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
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-langchain"
3-
version = "0.0.122"
3+
version = "0.0.123"
44
description = "UiPath Langchain"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_langchain/_utils/_request_mixin.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
stop_after_attempt,
1818
wait_exponential_jitter,
1919
)
20+
from uipath._cli._runtime._contracts import UiPathErrorCategory
2021
from uipath._utils._ssl_context import get_httpx_client_kwargs
2122

23+
from uipath_langchain._cli._runtime._exception import LangGraphRuntimeError
2224
from uipath_langchain._utils._settings import (
2325
UiPathClientFactorySettings,
2426
UiPathClientSettings,
@@ -348,6 +350,19 @@ def _make_status_error(
348350
return openai.AuthenticationError(err_msg, response=response, body=data)
349351

350352
if response.status_code == 403:
353+
# Check if this is a license-specific error
354+
if isinstance(body, dict):
355+
title = body.get("title", "").lower()
356+
if title == "license not available":
357+
raise LangGraphRuntimeError(
358+
code="LICENSE_NOT_AVAILABLE",
359+
title=body.get("title", "License Not Available"),
360+
detail=body.get(
361+
"detail", "License not available for this service"
362+
),
363+
category=UiPathErrorCategory.DEPLOYMENT,
364+
)
365+
351366
return openai.PermissionDeniedError(err_msg, response=response, body=data)
352367

353368
if response.status_code == 404:

0 commit comments

Comments
 (0)