MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / logError

Function logError

src/agents/claude-code.ts:37–49  ·  view source on GitHub ↗
(value: unknown, options: Agent.RunOptions)

Source from the content-addressed store, hash-verified

35}
36
37function logError(value: unknown, options: Agent.RunOptions): void {
38 let message: string;
39 try {
40 message = JSON.stringify(value);
41 } catch (error) {
42 message = JSON.stringify({
43 error: "serialization_failed",
44 reason: error instanceof Error ? error.message : String(error),
45 });
46 }
47
48 process.stderr.write(`${options.logger.format(message)}\n`);
49}
50
51function serializeError(error: unknown): Record<string, unknown> {
52 if (error instanceof Error) {

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected