Skip to content

Implement ErrorCard for terminal#74

Open
icedoutskay wants to merge 1 commit intoToolbox-Lab:mainfrom
icedoutskay:feat/errorCard
Open

Implement ErrorCard for terminal#74
icedoutskay wants to merge 1 commit intoToolbox-Lab:mainfrom
icedoutskay:feat/errorCard

Conversation

@icedoutskay
Copy link
Copy Markdown

ErrorCard Renderer for Transaction Errors

Summary

Implements ErrorCard renderer that displays transaction errors prominently with a bold red border and categorical labels, making errors impossible to miss.

Changes

  • renderers.rs: Added ErrorCard struct and render_error_card() function
    • Bold red block character border
    • Error category badge in uppercase
    • Error name with code
    • Contract component information (when applicable)
    • Human-readable summary
  • human.rs: Integrated ErrorCard at the top of diagnostic reports
  • BudgetBar: Fixed missing render() method with percentage calculations and color coding

Testing

  • 8 comprehensive unit tests covering basic rendering, component display, styling, and edge cases
  • All tests pass successfully

Files Modified

  • crates/cli/src/output/renderers.rs - New ErrorCard implementation
  • crates/cli/src/output/human.rs - Integration into report output

Example Output

████████████████████████████████████
█ [CONTRACT]
█ ❌ InsufficientBalance (1)
█ Component: CBDLTOJWR2YX2U6BR3P5C4UXKWHE5DJW3JPSIOEXTW2E7D5JUDPQULE7
█ The account does not have enough balance to complete transaction.
████████████████████████████████████

This PR closes #14

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@icedoutskay Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Emrys02 Emrys02 self-requested a review March 26, 2026 14:58
Copy link
Copy Markdown
Contributor

@Emrys02 Emrys02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@icedoutskay PR reviewed and confirmed, thanks

@Emrys02
Copy link
Copy Markdown
Contributor

Emrys02 commented Mar 26, 2026

@icedoutskay fix conflict in your branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement ErrorCard for terminal

2 participants