extractErrorFromResult

abstract fun extractErrorFromResult(context: ToolContext, tool: BaseTool, args: Map<String, Any?>, result: Map<String, Any?>): Any?

Returns the error in result, such as result itself when it holds "status": "error", or null if the call succeeded.

Past the limit, if ReflectAndRetryToolPlugin.throwExceptionIfRetryExceeded is set, the plugin throws a Throwable error as is (logged with its message) and any other error as an IllegalStateException with a generic message. A Map error reaches the model as data, not text, so like a tool result it must hold only JSON-native values.