MCPcopy Create free account
hub / github.com/coder/mux / buildMissingFileError

Function buildMissingFileError

src/node/utils/attachments/readAttachmentFromPath.ts:127–136  ·  view source on GitHub ↗
(resolvedPath: string, error: unknown)

Source from the content-addressed store, hash-verified

125}
126
127function buildMissingFileError(resolvedPath: string, error: unknown): Error {
128 const message = getErrorMessage(error);
129 if (message.includes("ENOENT") || message.toLowerCase().includes("not found")) {
130 return new Error(`File not found: ${resolvedPath}`);
131 }
132 if (message.includes("EACCES") || message.toLowerCase().includes("permission denied")) {
133 return new Error(`Permission denied: ${resolvedPath}`);
134 }
135 return new Error(message);
136}
137
138async function statRegularFile(
139 args: ReadAttachmentFromPathArgs,

Callers 2

statRegularFileFunction · 0.85
readRegularFileBytesFunction · 0.85

Calls 1

getErrorMessageFunction · 0.90

Tested by

no test coverage detected