MCPcopy
hub / github.com/codeaashu/claude-code / renderToolUseErrorMessage

Function renderToolUseErrorMessage

src/tools/FileReadTool/UI.tsx:144–164  ·  view source on GitHub ↗
(result: ToolResultBlockParam['content'], {
  verbose
}: {
  verbose: boolean;
})

Source from the content-addressed store, hash-verified

142 }
143}
144export function renderToolUseErrorMessage(result: ToolResultBlockParam['content'], {
145 verbose
146}: {
147 verbose: boolean;
148}): React.ReactNode {
149 if (!verbose && typeof result === 'string') {
150 // FileReadTool throws from call() so errors lack <tool_use_error> wrapping —
151 // check the raw string directly for the cwd note marker.
152 if (result.includes(FILE_NOT_FOUND_CWD_NOTE)) {
153 return <MessageResponse>
154 <Text color="error">File not found</Text>
155 </MessageResponse>;
156 }
157 if (extractTag(result, 'tool_use_error')) {
158 return <MessageResponse>
159 <Text color="error">Error reading file</Text>
160 </MessageResponse>;
161 }
162 }
163 return <FallbackToolUseErrorMessage result={result} verbose={verbose} />;
164}
165export function userFacingName(input: Partial<Input> | undefined): string {
166 if (input?.file_path?.startsWith(getPlansDirectory())) {
167 return 'Reading Plan';

Callers

nothing calls this directly

Calls 1

extractTagFunction · 0.85

Tested by

no test coverage detected