# Show on custom exceptions in Julia 0.6

**URL:** <https://discourse.julialang.org/t/show-on-custom-exceptions-in-julia-0-6/1288>\
**Category:** Offtopic\
**Tags:** question\
**Created:** [January 4, 2017, 6:27pm UTC](https://discourse.julialang.org/t/show-on-custom-exceptions-in-julia-0-6/1288 "2017-01-04T18:27:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![omus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/omus/32/402_2.png) [@omus](https://discourse.julialang.org/u/omus)\
**Post date:** [January 4, 2017, 6:27pm UTC](https://discourse.julialang.org/t/show-on-custom-exceptions-in-julia-0-6/1288/1 "2017-01-04T18:27:28Z")

</div>

I’m having some issues with `throw` not calling `showerror` on custom exceptions. I’m pretty sure that this is a bug but I just wanted to check that this wasn’t intentional:

```julia
julia> type MyUndefVarError <: Exception
           var::Symbol
       end

julia> Base.showerror(io::IO, e::MyUndefVarError) = print(io, e.var, " not defined");

julia> showerror(STDOUT, UndefVarError(:foo))
UndefVarError: foo not defined

julia> showerror(STDOUT, MyUndefVarError(:foo))
foo not defined

julia> throw(UndefVarError(:foo))
ERROR: UndefVarError: foo not defined

julia> throw(MyUndefVarError(:foo)) # Should show `ERROR: foo not defined`
ERROR: MyUndefVarError(:foo)

```

---

<div class="post-metadata">

**Author:** ![omus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/omus/32/402_2.png) [@omus](https://discourse.julialang.org/u/omus)\
**Post date:** [January 4, 2017, 6:28pm UTC](https://discourse.julialang.org/t/show-on-custom-exceptions-in-julia-0-6/1288/2 "2017-01-04T18:28:42Z")

</div>

I forgot to mention: Julia 0.6.0-dev.1898 (2e0b00180)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 4, 2017, 6:55pm UTC](https://discourse.julialang.org/t/show-on-custom-exceptions-in-julia-0-6/1288/3 "2017-01-04T18:55:41Z")

</div>

I think it’s a bug. `Base.display_error(e, catch_backtrace())` works fine, so I think the problem is that it’s being called with an obsolete world-age. (This is the rather tricky new feature that @vtjnash implemented to solve #265, so that functions are automatically recompiled when dependent functions are changed. Unfortunately, it has subtle effects for code like the REPL itself, which is both running and also evaluating user code.)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 4, 2017, 7:00pm UTC](https://discourse.julialang.org/t/show-on-custom-exceptions-in-julia-0-6/1288/4 "2017-01-04T19:00:04Z")

</div>

Filed an issue: [https://github.com/JuliaLang/julia/issues/19864](https://github.com/JuliaLang/julia/issues/19864)
