common: use the 'data' field for agent error info

The JSON-PRC specs "data" as the correct field name for
extra error data.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan committed 2025-10-04 17:02:53 -04:00
1 parent 5836eab233
commit f2bb93ffc4
1 file changed
+2 -2
+2 -2
View File
@@ -878,9 +878,9 @@ class JsonRPC:
log_msg = f"JSON-RPC Request Error - {method_name}Code: {code}, Message: {msg}"
err = {'code': code, 'message': msg}
if isinstance(exc, AgentError):
err["extra"] = exc.error_data
err["data"] = exc.error_data
if self.verbose:
log_msg += f"\nExtra: {exc.error_data}"
log_msg += f"\nExtra data: {exc.error_data}"
logging.info(log_msg, exc_info=(exc is not None and self.verbose))
return {
'jsonrpc': "2.0",