From 44e276ae4fb8d3b70553990c55e3a6133f38bae4 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Wed, 28 May 2025 17:55:40 -0700 Subject: [PATCH] refactor: simplify error display to show clean error messages only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove collapsible
section for error messages - Display errors in simple code blocks since messages are now clean and short - Makes error messages more direct and readable 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/github/operations/comment-logic.ts | 2 +- test/comment-logic.test.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/github/operations/comment-logic.ts b/src/github/operations/comment-logic.ts index bc0253d..6a4551a 100644 --- a/src/github/operations/comment-logic.ts +++ b/src/github/operations/comment-logic.ts @@ -183,7 +183,7 @@ export function updateCommentBody(input: CommentUpdateInput): string { // Add error details if available if (actionFailed && errorDetails) { - newBody += `\n\n
\nError details\n\n\`\`\`\n${errorDetails}\n\`\`\`\n\n
`; + newBody += `\n\n\`\`\`\n${errorDetails}\n\`\`\``; } newBody += `\n\n---\n`; diff --git a/test/comment-logic.test.ts b/test/comment-logic.test.ts index 7488400..82fec08 100644 --- a/test/comment-logic.test.ts +++ b/test/comment-logic.test.ts @@ -51,11 +51,9 @@ describe("updateCommentBody", () => { const result = updateCommentBody(input); expect(result).toContain("**Claude encountered an error after 45s**"); expect(result).toContain("[View job]"); - expect(result).toContain("
"); - expect(result).toContain("Error details"); - expect(result).toContain("Failed to fetch issue data"); + expect(result).toContain("```\nFailed to fetch issue data\n```"); // Ensure error details come after the header/links - const errorIndex = result.indexOf("
"); + const errorIndex = result.indexOf("```"); const headerIndex = result.indexOf("**Claude encountered an error"); expect(errorIndex).toBeGreaterThan(headerIndex); });