Skip to content

Commit e7855e6

Browse files
suggestions
Co-Authored-By: Jameson Nash <[email protected]>
1 parent d25c7f1 commit e7855e6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

base/experimental.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ function show_error_hints(io, ex, args...)
319319
for handler in hinters
320320
try
321321
@invokelatest handler(io, ex, args...)
322-
catch err
322+
catch
323323
tn = typeof(handler).name
324-
@error "Hint-handler $handler for $(typeof(ex)) in $(tn.module) caused an error" err
324+
@error "Hint-handler $handler for $(typeof(ex)) in $(tn.module) caused an error" exception=current_exceptions()
325325
end
326326
end
327327
end

stdlib/REPL/src/REPL.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ function _UndefVarError_warnfor(io::IO, m::Module, var::Symbol)
7676
(Base.isexported(m, var) || Base.ispublic(m, var)) || return false
7777
active_mod = Base.active_module()
7878
mod_imported = isdefined(active_mod, Symbol(m))
79-
if !mod_imported && Symbol(m) == var
80-
print(io, "\nHint: $m is loaded but not imported in the active module `$(active_mod)`.")
79+
print(io, "\nHint: ")
80+
if mod_imported
81+
print(io, "a global variable of this name also exists in $m.")
8182
else
82-
print(io, "\nHint: a global variable of this name also exists in $m")
83-
if mod_imported
84-
print(io, ".")
83+
if Symbol(m) == var
84+
print(io, "$m is loaded but not imported in the active module $(active_mod).")
8585
else
86-
print(io, ", which is loaded but not imported in the active module `$(active_mod)`.")
86+
print(io, "a global variable of this name may be made accessible by importing $m in the current active module $active_mod")
8787
end
8888
end
8989
return true

0 commit comments

Comments
 (0)