(resolvedPath: string, error: unknown)
| 125 | } |
| 126 | |
| 127 | function 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 | |
| 138 | async function statRegularFile( |
| 139 | args: ReadAttachmentFromPathArgs, |
no test coverage detected