mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
refactor: simplify error display to show clean error messages only
- Remove collapsible <details> 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 <noreply@anthropic.com>
This commit is contained in:
@@ -183,7 +183,7 @@ export function updateCommentBody(input: CommentUpdateInput): string {
|
|||||||
|
|
||||||
// Add error details if available
|
// Add error details if available
|
||||||
if (actionFailed && errorDetails) {
|
if (actionFailed && errorDetails) {
|
||||||
newBody += `\n\n<details>\n<summary>Error details</summary>\n\n\`\`\`\n${errorDetails}\n\`\`\`\n\n</details>`;
|
newBody += `\n\n\`\`\`\n${errorDetails}\n\`\`\``;
|
||||||
}
|
}
|
||||||
|
|
||||||
newBody += `\n\n---\n`;
|
newBody += `\n\n---\n`;
|
||||||
|
|||||||
@@ -51,11 +51,9 @@ describe("updateCommentBody", () => {
|
|||||||
const result = updateCommentBody(input);
|
const result = updateCommentBody(input);
|
||||||
expect(result).toContain("**Claude encountered an error after 45s**");
|
expect(result).toContain("**Claude encountered an error after 45s**");
|
||||||
expect(result).toContain("[View job]");
|
expect(result).toContain("[View job]");
|
||||||
expect(result).toContain("<details>");
|
expect(result).toContain("```\nFailed to fetch issue data\n```");
|
||||||
expect(result).toContain("<summary>Error details</summary>");
|
|
||||||
expect(result).toContain("Failed to fetch issue data");
|
|
||||||
// Ensure error details come after the header/links
|
// Ensure error details come after the header/links
|
||||||
const errorIndex = result.indexOf("<details>");
|
const errorIndex = result.indexOf("```");
|
||||||
const headerIndex = result.indexOf("**Claude encountered an error");
|
const headerIndex = result.indexOf("**Claude encountered an error");
|
||||||
expect(errorIndex).toBeGreaterThan(headerIndex);
|
expect(errorIndex).toBeGreaterThan(headerIndex);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user