MarshalErrorJSON renders a stable JSON error object for agent CLI commands.
(err error)
| 142 | |
| 143 | // MarshalErrorJSON renders a stable JSON error object for agent CLI commands. |
| 144 | func MarshalErrorJSON(err error) ([]byte, error) { |
| 145 | return json.Marshal(struct { |
| 146 | Error ErrorPayload `json:"error"` |
| 147 | }{Error: ErrorPayloadFor(err)}) |
| 148 | } |
| 149 | |
| 150 | // MarshalErrorJSONL renders one stable JSONL error frame for agent CLI streaming commands. |
| 151 | func MarshalErrorJSONL(err error) ([]byte, error) { |