diff --git a/libs/arcade-tdk/arcade_tdk/providers/google/error_adapter.py b/libs/arcade-tdk/arcade_tdk/providers/google/error_adapter.py index 6baf4768..b5756272 100644 --- a/libs/arcade-tdk/arcade_tdk/providers/google/error_adapter.py +++ b/libs/arcade-tdk/arcade_tdk/providers/google/error_adapter.py @@ -75,9 +75,9 @@ class GoogleErrorAdapter: } # Try to extract request details if available - if hasattr(error, "uri"): + if hasattr(error, "uri") and error.uri: extra["endpoint"] = self._sanitize_uri(error.uri) - if hasattr(error, "method_"): + if hasattr(error, "method_") and error.method_: extra["http_method"] = error.method_.upper() # Special case for rate limiting diff --git a/libs/arcade-tdk/arcade_tdk/tool.py b/libs/arcade-tdk/arcade_tdk/tool.py index e6fd057d..943d6a81 100644 --- a/libs/arcade-tdk/arcade_tdk/tool.py +++ b/libs/arcade-tdk/arcade_tdk/tool.py @@ -1,5 +1,6 @@ import functools import inspect +import logging from typing import Any, Callable, TypeVar from arcade_tdk.auth import ToolAuthorization @@ -14,6 +15,8 @@ from arcade_tdk.utils import snake_to_pascal_case T = TypeVar("T") +logger = logging.getLogger(__name__) + def _build_adapter_chain( adapters: list[ErrorAdapter] | None, auth_provider: ToolAuthorization | None @@ -81,7 +84,13 @@ def _raise_as_arcade_error( ToolRuntimeError or some subclass thereof """ for adapter in adapter_chain: - mapped = adapter.from_exception(exception) + try: + mapped = adapter.from_exception(exception) + except Exception as e: + logger.warning( + f"Failed to map exception to Arcade Error with adapter {adapter.slug}: {e}" + ) + continue if isinstance(mapped, ToolRuntimeError): raise mapped from exception diff --git a/libs/arcade-tdk/pyproject.toml b/libs/arcade-tdk/pyproject.toml index d7e2cd95..340db79b 100644 --- a/libs/arcade-tdk/pyproject.toml +++ b/libs/arcade-tdk/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "arcade-tdk" -version = "2.3.0" +version = "2.3.1" description = "Arcade TDK - Toolkit Development Kit for building Arcade tools" readme = "README.md" license = {text = "MIT"} diff --git a/pyproject.toml b/pyproject.toml index 45b30363..6edc4a55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "arcade-ai" -version = "2.2.0" +version = "2.2.1" description = "Arcade.dev - Tool Calling platform for Agents" readme = "README.md" license = {file = "LICENSE"} @@ -42,7 +42,7 @@ all = [ # serve "arcade-serve>=2.1.0,<3.0.0", # tdk - "arcade-tdk>=2.3.0,<3.0.0", + "arcade-tdk>=2.3.1,<3.0.0", ] # Evals also depends on arcade-core and openai, but they are already required deps evals = [