MCPcopy Create free account
hub / github.com/anomalyco/opencode / formatErrorString

Function formatErrorString

packages/web/src/components/share/part.tsx:371–387  ·  view source on GitHub ↗
(error: string, label: string)

Source from the content-addressed store, hash-verified

369}
370
371function formatErrorString(error: string, label: string): JSX.Element {
372 const errorMarker = "Error: "
373 const startsWithError = error.startsWith(errorMarker)
374
375 return startsWithError ? (
376 <pre>
377 <span data-color="red" data-marker="label" data-separator>
378 {label}
379 </span>
380 <span>{error.slice(errorMarker.length)}</span>
381 </pre>
382 ) : (
383 <pre>
384 <span data-color="dimmed">{error}</span>
385 </pre>
386 )
387}
388
389export function TodoWriteTool(props: ToolProps) {
390 const messages = useShareMessages()

Callers 5

PartFunction · 0.85
WebFetchToolFunction · 0.85
ReadToolFunction · 0.85
WriteToolFunction · 0.85
EditToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected