> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockx.chaintable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 结果与错误

> 任务结果字段、RPC 错误与执行失败。

准入与传输错误读取 RPC 状态。任务开始执行后，读取其终态与 `TaskResult`。Protobuf 定义位于 `api/grpc/worker/worker.proto`。

## 结果字段

| 字段 | 含义 |
| - | - |
| `state` | 外层响应或更新中的任务状态 |
| `result.success` | 任务是否成功完成 |
| `result.execute_result.failure_code` | 执行失败分类 |
| `result.execute_result.failure_message` | 可读的失败详情 |
| `result.execute_result.retryable` | 执行失败是否被归为可重试 |
| `result.execute_result.plugin_results` | 各 Plugin 的名称、成功标识、失败码与 JSON 结果字节 |

`WatchTasks` 更新还包含 `is_terminal`。未知任务通过更新中的 `error` 报告。结果在配置的保留期内保存，`RESULT_RETENTION_MS` 默认为 `300000`。

## Writer 结果

| Writer 路径 | 结果内容 |
| - | - |
| `ReturnValueHandler` | 收集到的输出组成的 JSON 数组 |
| block 表区块写入 | `written_rows`、`finish_time` |
| block 表 bundle 写入 | `written_rows`、`finish_time`、`job_id` |

Debug 写入不会创建存储作业。统计值和任务成功不能替代存储就绪检查。

## RPC 错误

| gRPC 状态 | 典型含义 |
| - | - |
| `InvalidArgument` | 请求、配置 JSON 非法或 handler 不受支持 |
| `ResourceExhausted` | 没有可用执行容量 |
| `FailedPrecondition` | slot 无效或已过期 |
| `Unavailable` | 服务未就绪或连接不可用 |
| `NotFound` | 选定 Worker 上没有任务结果 |
| `Aborted` | 预占结果不确定 |

## 执行失败

| 错误码 | 检查项 |
| - | - |
| `BUILDER_FAILED` | 源数据与输入配置 |
| `CALL_FAILED` | 函数、审计结果、EVM 读取和合约调用 |
| `PLUGIN_FAILED` | 目标 schema、输出配置与写入结果 |
| `TIMED_OUT` | 执行时长与后端可用性 |
| `OUTPUT_BYTES_EXCEEDED` | 收集到的输出大小 |
| `WATCH_DISCONNECTED` | Watch 连接生命周期 |

结合返回的可重试分类与写入状态处理失败。重复提交终态任务标识不会强制重新执行；见[失败处理](/zh/guides/results-and-failures)。

## 相关文档

* [执行语义与结果](/zh/concepts/execution-semantics)
* [服务 API](/zh/reference/service-api)
* [可观测性](/zh/components/observability)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.