Skip to content

Review and improve exception presentation#443

Merged
ocots merged 5 commits into
developfrom
exception-presentation-review
Jun 9, 2026
Merged

Review and improve exception presentation#443
ocots merged 5 commits into
developfrom
exception-presentation-review

Conversation

@ocots

@ocots ocots commented Jun 9, 2026

Copy link
Copy Markdown
Member

Overview

This PR reviews and improves the presentation of exceptions in CTBase.jl, as identified in PR #438.

Tasks

  • Review show methods for exceptions in src/Exceptions/display.jl
  • Verify error messages are appropriate (e.g., when calling ctindice(-1))
  • Update documentation if needed
  • Ensure consistency across all exception types
  • Test exception display in various contexts

Implementation

The exception display redesign has been implemented in PR #444. Key improvements:

  • Replaced emoji-based layout with pipe-box structure using separators
  • Type name on first line with caller location when available
  • Aligned labels (Got, Expected, Reason, Hint, Context, etc.) padded to common width
  • Color coding: red for type name, yellow for warnings, green for hints
  • Dynamic Hint generation for ExtensionError based on weakdeps
  • Modular rendering functions for easier maintenance
  • Colorblind-friendly (no reliance on emoji colors)

Context

This work stems from PR #438 which mentions the need to review exception presentation. The goal is to ensure that error messages are clear, helpful, and consistent across the codebase.

Related

ocots added 2 commits June 9, 2026 12:20
…gative vs multi-digit values

- Split error condition in ctindice(): i < 0 now shows "must be positive" (expected: ≥ 0), i > 9 shows "must be a single digit" with suggestion to use ctindices()
- Split error condition in ctupperscript(): same pattern with ctupperscripts() suggestion
- Updated tests to verify new error messages
- All 90 tests in test/suite/unicode/ pass
@ocots

ocots commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

This PR addresses the exception presentation review mentioned in #438.

The goal is to systematically review and improve how exceptions are displayed in CTBase.jl, ensuring:

  • Error messages are clear and helpful
  • Consistency across all exception types
  • Appropriate context and suggestions for users
  • Good documentation of exception usage

This will help users better understand and fix errors when they occur, especially for cases like ctindice(-1) mentioned in #438.

@ocots ocots linked an issue Jun 9, 2026 that may be closed by this pull request
ocots added 2 commits June 9, 2026 13:30
- Refactored display.jl to use modular rendering functions
- Added structured exception context display with sections
- Improved error message formatting with clear hierarchy
- Updated tests to cover new display behavior
- Updated documentation in exceptions.md and index.md
…edesign

Redesign exception display with improved formatting and structure
@ocots
ocots marked this pull request as ready for review June 9, 2026 11:32
@ocots
ocots merged commit 7e443df into develop Jun 9, 2026
4 checks passed
@ocots
ocots deleted the exception-presentation-review branch June 9, 2026 11:32
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.

Review and improve exception presentation

1 participant