Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
Co-Authored-By: Jameson Nash <vtjnash+github@gmail.com>
  • Loading branch information
IanButterworth and vtjnash committed Oct 1, 2024
1 parent d25c7f1 commit e7855e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions base/experimental.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ function show_error_hints(io, ex, args...)
for handler in hinters
try
@invokelatest handler(io, ex, args...)
catch err
catch
tn = typeof(handler).name
@error "Hint-handler $handler for $(typeof(ex)) in $(tn.module) caused an error" err
@error "Hint-handler $handler for $(typeof(ex)) in $(tn.module) caused an error" exception=current_exceptions()
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ function _UndefVarError_warnfor(io::IO, m::Module, var::Symbol)
(Base.isexported(m, var) || Base.ispublic(m, var)) || return false
active_mod = Base.active_module()
mod_imported = isdefined(active_mod, Symbol(m))
if !mod_imported && Symbol(m) == var
print(io, "\nHint: $m is loaded but not imported in the active module `$(active_mod)`.")
print(io, "\nHint: ")
if mod_imported
print(io, "a global variable of this name also exists in $m.")
else
print(io, "\nHint: a global variable of this name also exists in $m")
if mod_imported
print(io, ".")
if Symbol(m) == var
print(io, "$m is loaded but not imported in the active module $(active_mod).")
else
print(io, ", which is loaded but not imported in the active module `$(active_mod)`.")
print(io, "a global variable of this name may be made accessible by importing $m in the current active module $active_mod")
end
end
return true
Expand Down

0 comments on commit e7855e6

Please sign in to comment.