MCPcopy Create free account
hub / github.com/compozy/agh / MarshalErrorJSON

Function MarshalErrorJSON

internal/agentidentity/errors.go:144–148  ·  view source on GitHub ↗

MarshalErrorJSON renders a stable JSON error object for agent CLI commands.

(err error)

Source from the content-addressed store, hash-verified

142
143// MarshalErrorJSON renders a stable JSON error object for agent CLI commands.
144func 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.
151func MarshalErrorJSONL(err error) ([]byte, error) {

Calls 1

ErrorPayloadForFunction · 0.85