Skip to content

feat: enriched exception system with user-friendly error messages#265

Merged
ocots merged 4 commits intodevelopfrom
feature/enriched-exceptions-migration
Jan 31, 2026
Merged

feat: enriched exception system with user-friendly error messages#265
ocots merged 4 commits intodevelopfrom
feature/enriched-exceptions-migration

Conversation

@ocots
Copy link
Copy Markdown
Member

@ocots ocots commented Jan 31, 2026

Summary

Transform CTModels error handling from cryptic CTBase exceptions to rich, actionable error messages that guide users toward resolution.

Key Features

  • Enriched exception types with suggestion, context, and location fields
  • Structured error display with emojis and clear sections
  • User code location (file, line, function) in error messages
  • Actionable suggestions for common error scenarios
  • Backward compatibility with CTBase via conversion functions

Migration Summary

  • ✅ 71/140 exceptions migrated (51% of total)
  • ✅ All critical user-facing workflows use enriched exceptions
  • ✅ 85%+ test coverage with comprehensive test suite
  • ✅ Full backward compatibility maintained

Impact

Significantly improved developer experience with clear error guidance, reducing debugging time and enhancing code quality.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 31, 2026

Breakage test results
Date: 2026-01-31 18:05:44

Name Latest Stable
CTDirect compat: v0.6.10-beta compat: v0.7.1-beta.1
CTFlows compat: v0.6.10-beta compat: v0.7.1-beta.1
OptimalControl compat: v0.6.10-beta compat: v0.6.10-beta

ocots added 3 commits January 31, 2026 17:00
- Replace CTBase.* with CTModels.Exceptions.* in all tests
- Fix exception constructor arguments (reason → got/expected)
- Add missing imports (using CTModels, using CTModels.Exceptions)
- Create aliases for OCP functions in integration tests
- Fix constraint dimensions in OCP tests
- Complete migration of 124/140 exceptions (100% active exceptions)
- All tests now validate enriched exceptions with structured messages
@ocots ocots merged commit efbbdfc into develop Jan 31, 2026
13 of 14 checks passed
@ocots ocots deleted the feature/enriched-exceptions-migration branch January 31, 2026 17:47
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.

1 participant