Handle tool execution errors with standardized format.
handle_tool_error(
error: Exception,
tool_name: str,
operation: str,
query: Optional[str] = None,
logger_instance: Optional[logging.Logger] = None
) -> str| Name | Type | Description |
|---|---|---|
error* | Exception | The exception that occurred |
tool_name* | str | Name of the tool that failed |
operation* | str | Description of the operation (e.g., "analyze sentiment") |
query | Optional[str] | Default: NoneOriginal query/input if applicable |
logger_instance | Optional[logging.Logger] | Default: NoneSpecific logger to use |