diff --git a/src/core/Cline.ts b/src/core/Cline.ts
index a7e999f6af..2d0c785c2e 100644
--- a/src/core/Cline.ts
+++ b/src/core/Cline.ts
@@ -1594,7 +1594,8 @@ export class Cline {
const accessAllowed = this.llmFileAccessController.validateAccess(relPath)
if (!accessAllowed) {
- await handleError("writing file", new Error(`Access denied: ${relPath} (blocked by .clineignore)`))
+ await this.say("clineignore_error", relPath)
+ pushToolResult(formatResponse.clineIgnoreError(relPath))
break
}
@@ -1870,10 +1871,8 @@ export class Cline {
const accessAllowed = this.llmFileAccessController.validateAccess(relPath)
if (!accessAllowed) {
- await handleError(
- "reading file",
- new Error(`Access denied: ${relPath} (blocked by .clineignore)`),
- )
+ await this.say("clineignore_error", relPath)
+ pushToolResult(formatResponse.clineIgnoreError(relPath))
break
}
diff --git a/src/core/prompts/responses.ts b/src/core/prompts/responses.ts
index 34341dba1d..7452106d5f 100644
--- a/src/core/prompts/responses.ts
+++ b/src/core/prompts/responses.ts
@@ -11,6 +11,9 @@ export const formatResponse = {
toolError: (error?: string) => `The tool execution failed with the following error:\n
{message.text} which is blocked by the{" "}
+ .clineignore
+ file settings.
+