Way to get module of undef variable?

If you do:

cur_error = nothing 

try 
  foo(bar::Main.baz) = "Rambo"
catch tmp_error
  cur_error = tmp_error
end

which gives

> cur_error
UndefVarError(:baz)

> cur_error.var
:baz

The thing I’m kind of curious about is if there is a way to get the module that should have :baz in it (i.e. Main)?

Replaced by github issue:

https://github.com/JuliaLang/julia/issues/25263