Skip to content

Commit da06a34

Browse files
authored
Slightly improve validation error message (#350)
1 parent 40f346d commit da06a34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/validation.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ const DYNAMIC_CALL = "dynamic function invocation"
113113
function Base.showerror(io::IO, err::InvalidIRError)
114114
print(io, "InvalidIRError: compiling ", err.job.source, " resulted in invalid LLVM IR")
115115
for (kind, bt, meta) in err.errors
116-
print(io, "\nReason: unsupported $kind")
116+
printstyled(io, "\nReason: unsupported $kind"; color=:red)
117117
if meta !== nothing
118118
if kind == RUNTIME_FUNCTION || kind == UNKNOWN_FUNCTION || kind == POINTER_FUNCTION || kind == DYNAMIC_CALL
119-
print(io, " (call to ", meta, ")")
119+
printstyled(io, " (call to ", meta, ")"; color=:red)
120120
elseif kind == DELAYED_BINDING
121-
print(io, " (use of '", meta, "')")
121+
printstyled(io, " (use of '", meta, "')"; color=:red)
122122
end
123123
end
124124
Base.show_backtrace(io, bt)
@@ -128,7 +128,7 @@ function Base.showerror(io::IO, err::InvalidIRError)
128128
printstyled(
129129
io,
130130
": catch this exception as `err` and call `code_typed(err; interactive = true)` to",
131-
" introspect the erronous code";
131+
" introspect the erronous code with Cthulhu.jl";
132132
color = :cyan,
133133
)
134134
return

0 commit comments

Comments
 (0)