@@ -236,7 +236,6 @@ CTBase.Exceptions.ParsingError <: CTBase.Exceptions.CTException
236236- ` msg::String ` : Error message
237237- ` location::Union{String,Nothing} ` : Where in the input the error occurred (optional)
238238- ` suggestion::Union{String,Nothing} ` : How to fix the syntax (optional)
239- - ` context::Union{String,Nothing} ` : What was being parsed (optional)
240239
241240** Example** :
242241
@@ -245,8 +244,7 @@ using CTBase
245244throw(CTBase.Exceptions.ParsingError(
246245 "unexpected token 'end'",
247246 location="line 42, column 10",
248- suggestion="Check for unmatched 'begin' or remove extra 'end'",
249- context="control flow parsing"
247+ suggestion="Check for unmatched 'begin' or remove extra 'end'"
250248))
251249```
252250
282280The enriched display automatically suggests:
283281
284282``` text
285- ❌ Error: ExtensionError, missing dependencies
286- 📦 Missing dependencies: Plots
287- 💡 Suggestion: julia> using Plots
283+ ExtensionError
284+ │
285+ │ missing dependencies
286+ │
287+ │ Missing Plots
288+ │
289+ │ Hint Run: using Plots
290+ └─
288291```
289292
290293** Use this exception** when:
@@ -331,10 +334,15 @@ end
331334The enriched display shows the solver-specific return code:
332335
333336``` text
334- ❌ Error: SolverFailure, ODE integration failed
335- 🔧 Return code: :Unstable
336- 📂 Context: SciML integrator
337- 💡 Suggestion: Reduce time step or check initial conditions
337+ SolverFailure
338+ │
339+ │ ODE integration failed
340+ │
341+ │ Retcode :Unstable
342+ │
343+ │ Context SciML integrator
344+ │ Hint Reduce time step or check initial conditions
345+ └─
338346```
339347
340348** Common return codes** :
@@ -372,23 +380,24 @@ The enriched display shows the solver-specific return code:
372380
373381All CTBase exceptions provide an enriched, user-friendly display with:
374382
375- - ** 🎯 Clear error type and message **
376- - ** 📋 Contextual information ** (got/expected, reason, location)
377- - ** 💡 Actionable suggestions ** for fixing the problem
378- - ** 📍 User code location ** tracking
379- - ** 🎨 Emoji-based visual hierarchy **
383+ - ** Type name ** on line 1, with caller location when available
384+ - ** Pipe-box layout ** using ` │ ` separators for visual structure
385+ - ** Aligned labels ** (Got, Expected, Reason, Hint, Context, …) padded to a common width
386+ - ** Color coding ** : red for type name, yellow for warnings, green for hints
387+ - ** Dynamic Hint ** for ` ExtensionError ` generated from ` weakdeps `
380388
381389Example of enriched display:
382390
383391``` text
384- Control Toolbox Error
385-
386- ❌ Error: PreconditionError, System must be initialized before configuration
387- ❓ Reason: initialize! not called yet
388- 📂 Context: system configuration
389- 💡 Suggestion: Call initialize!(state) before configure!
390- 📍 In your code:
391- configure! at MyModule.jl:42
392+ PreconditionError → configure! MyModule.jl:42
393+ │
394+ │ System must be initialized before configuration
395+ │
396+ │ Reason initialize! not called yet
397+ │
398+ │ Context system configuration
399+ │ Hint Call initialize!(state) before configure!
400+ └─
392401```
393402
394403This makes debugging faster by providing all the information needed to understand and fix the problem.
0 commit comments