Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow packages to provide custom hints for Exceptions #35094

Merged
merged 8 commits into from
Mar 20, 2020
Merged
Prev Previous commit
Next Next commit
Don't test for color in demo
  • Loading branch information
timholy committed Mar 14, 2020
commit 20e2afe2fd40b0b56b036d034a0cd50102742895
8 changes: 2 additions & 6 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ julia> module Hinter
function __init__()
register_error_hint(MethodError) do io, exc, argtypes, kwargs
if exc.f == only_int
if get(io, :color, false)
print(io, "\nDid you mean to call ")
printstyled(io, "`any_number`?", color=:light_magenta)
else
print(io, "\nDid you mean to call `any_number`?")
end
print(io, "\nDid you mean to call ")
printstyled(io, "`any_number`?", color=:light_magenta)
end
end
end
Expand Down