@@ -12,7 +12,7 @@ Apply dimmed (faint) ANSI styling to a string.
1212# Returns
1313- `String`: The string wrapped in dim ANSI escape codes.
1414"""
15- _dim (s) = " \0 33[2m$(s) \0 33[0m"
15+ _dim (s) = " \0 33[2m$(s) \0 33[0m"
1616
1717"""
1818$(TYPEDSIGNATURES)
@@ -25,7 +25,7 @@ Apply bold ANSI styling to a string.
2525# Returns
2626- `String`: The string wrapped in bold ANSI escape codes.
2727"""
28- _bold (s) = " \0 33[1m$(s) \0 33[0m"
28+ _bold (s) = " \0 33[1m$(s) \0 33[0m"
2929
3030"""
3131$(TYPEDSIGNATURES)
@@ -38,7 +38,7 @@ Apply red ANSI styling to a string.
3838# Returns
3939- `String`: The string wrapped in red ANSI escape codes.
4040"""
41- _red (s) = " \0 33[1;31m$(s) \0 33[0m"
41+ _red (s) = " \0 33[1;31m$(s) \0 33[0m"
4242
4343"""
4444$(TYPEDSIGNATURES)
@@ -64,7 +64,7 @@ Apply green ANSI styling to a string.
6464# Returns
6565- `String`: The string wrapped in green ANSI escape codes.
6666"""
67- _green (s) = " \0 33[32m$(s) \0 33[0m"
67+ _green (s) = " \0 33[32m$(s) \0 33[0m"
6868
6969"""
7070 extract_user_frames(st::Vector)
@@ -136,7 +136,7 @@ Build primary field `(label, value, color)` tuples for `IncorrectArgument` displ
136136"""
137137function _build_primary_pairs (e:: IncorrectArgument )
138138 pairs = []
139- ! isnothing (e. got) && push! (pairs, (" Got" , string (e. got), :yellow ))
139+ ! isnothing (e. got) && push! (pairs, (" Got" , string (e. got), :yellow ))
140140 ! isnothing (e. expected) && push! (pairs, (" Expected" , string (e. expected), :green ))
141141 return pairs
142142end
@@ -177,7 +177,8 @@ Build primary field `(label, value, color)` tuples for `NotImplemented` display.
177177"""
178178function _build_primary_pairs (e:: NotImplemented )
179179 pairs = []
180- ! isnothing (e. required_method) && push! (pairs, (" Method" , string (e. required_method), :default ))
180+ ! isnothing (e. required_method) &&
181+ push! (pairs, (" Method" , string (e. required_method), :default ))
181182 return pairs
182183end
183184
@@ -218,7 +219,8 @@ Build primary field `(label, value, color)` tuples for `AmbiguousDescription` di
218219"""
219220function _build_primary_pairs (e:: AmbiguousDescription )
220221 pairs = []
221- ! isnothing (e. diagnostic) && push! (pairs, (" Diagnostic" , _format_diagnostic (e. diagnostic), :yellow ))
222+ ! isnothing (e. diagnostic) &&
223+ push! (pairs, (" Diagnostic" , _format_diagnostic (e. diagnostic), :yellow ))
222224 push! (pairs, (" Requested" , string (e. description), :default ))
223225 if ! isnothing (e. candidates) && ! isempty (e. candidates)
224226 push! (pairs, (" Available" , e. candidates, :default ))
@@ -283,8 +285,12 @@ Build secondary field `(label, value, color)` tuples for generic `CTException` d
283285"""
284286function _build_secondary_pairs (e:: CTException )
285287 pairs = []
286- hasfield (typeof (e), :context ) && ! isnothing (e. context) && push! (pairs, (" Context" , e. context, :default ))
287- hasfield (typeof (e), :suggestion ) && ! isnothing (e. suggestion) && push! (pairs, (" Hint" , e. suggestion, :green ))
288+ hasfield (typeof (e), :context ) &&
289+ ! isnothing (e. context) &&
290+ push! (pairs, (" Context" , e. context, :default ))
291+ hasfield (typeof (e), :suggestion ) &&
292+ ! isnothing (e. suggestion) &&
293+ push! (pairs, (" Hint" , e. suggestion, :green ))
288294 return pairs
289295end
290296
@@ -404,7 +410,7 @@ function _format_user_friendly_error(io::IO, e::CTException)
404410 println (io, _dim (" │" ), " " , _bold (e. msg))
405411
406412 # Build field pairs
407- primary_pairs = _build_primary_pairs (e)
413+ primary_pairs = _build_primary_pairs (e)
408414 secondary_pairs = _build_secondary_pairs (e)
409415 all_pairs = vcat (primary_pairs, secondary_pairs)
410416
@@ -432,7 +438,7 @@ function _format_user_friendly_error(io::IO, e::CTException)
432438 end
433439
434440 # Closing visual
435- println (io, _dim (" └─" ))
441+ return println (io, _dim (" └─" ))
436442end
437443
438444"""
0 commit comments