What does `SYSTEM: show(lasterr) caused an error` mean ?

Hello,
Today I had this error:

SYSTEM: show(lasterr) caused an error
KeyError(:default)

I forgot to put a double == instead of a = for a comparison. Ok, maybe I am stupid BUT it is not very friendly for the REPL to throw this error, followed by ±100 lines of Stack-trace and just crash/exit just for a missing =.
So my question is why this awful error, why a REPL crash for a simple mistake ?

Here is the stack trace:

Stacktrace:
 [1] getindex(::Dict{Any,Any}, ::Symbol) at ./dict.jl:478
 [2] answer_color() at ./client.jl:28
 [3] answer_color at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:1049 [inlined]
 [4] display(::REPL.REPLDisplay, ::MIME{Symbol("text/plain")}, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:130
 [5] display(::REPL.REPLDisplay, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:135
 [6] display(::Function) at ./multimedia.jl:287
 [7] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [8] invokelatest at ./essentials.jl:685 [inlined]
 [9] print_response(::IO, ::Any, ::Any, ::Bool, ::Bool, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:154
 [10] print_response(::REPL.AbstractREPL, ::Any, ::Any, ::Bool, ::Bool) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:139
 [11] (::getfield(REPL, Symbol("#do_respond#40")){Bool,getfield(REPL, Symbol("##50#59")){REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:708
 [12] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [13] invokelatest at ./essentials.jl:685 [inlined]
 [14] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:2261
 [15] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:1029
 [16] run_repl(::REPL.AbstractREPL, ::Any) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:191
 [17] (::getfield(Base, Symbol("##720#722")){Bool,Bool,Bool,Bool})(::Module) at ./logging.jl:311
 [18] #invokelatest#1 at ./essentials.jl:686 [inlined]
 [19] invokelatest at ./essentials.jl:685 [inlined]
 [20] macro expansion at ./logging.jl:308 [inlined]
 [21] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:330
 [22] exec_options(::Base.JLOptions) at ./client.jl:242
 [23] _start() at ./client.jl:421
fatal: error thrown and no exception handler available.
Base.KeyError(key=:default)
rec_backtrace at /Users/osx/buildbot/slave/package_osx64/build/src/stackwalk.c:94
record_backtrace at /Users/osx/buildbot/slave/package_osx64/build/src/task.c:246 [inlined]
jl_throw at /Users/osx/buildbot/slave/package_osx64/build/src/task.c:577
getindex at ./dict.jl:478 [inlined]
#with_output_color#661 at ./util.jl:373
unknown function (ip: 0x12572874b)
jl_fptr_trampoline at /Users/osx/buildbot/slave/package_osx64/build/src/gf.c:1829
#with_output_color at ./none:0 [inlined]
#printstyled#662 at ./util.jl:398 [inlined]
#printstyled at ./none:0
jl_fptr_trampoline at /Users/osx/buildbot/slave/package_osx64/build/src/gf.c:1829
display_error at ./client.jl:93
jl_fptr_trampoline at /Users/osx/buildbot/slave/package_osx64/build/src/gf.c:1829
display_error at ./client.jl:102
jl_fptr_trampoline at /Users/osx/buildbot/slave/package_osx64/build/src/gf.c:1829
jl_apply at /Users/osx/buildbot/slave/package_osx64/build/src/./julia.h:1536 [inlined]
jl_f__apply at /Users/osx/buildbot/slave/package_osx64/build/src/builtins.c:556
jl_f__apply_latest at /Users/osx/buildbot/slave/package_osx64/build/src/builtins.c:594
#invokelatest#1 at ./essentials.jl:686 [inlined]
invokelatest at ./essentials.jl:685 [inlined]
_start at ./client.jl:423
true_main at /Applications/Julia-1.0.app/Contents/Resources/julia/bin/julia (unknown line)
main at /Applications/Julia-1.0.app/Contents/Resources/julia/bin/julia (unknown line)

Welcome to Julia!

The REPL crashing should not happen. Can you post the steps to reproduce the error (if possible always include a MWE, minimal working example; in this case of course the MWE is not working :wink: ).

Do you have JULIA_ANSWER_COLOR environment variable set (perhaps to default)?.

Sorry, I wasn’t able to reproduce. I don’t have my code anymore. I’ll let you know if anything new happens. I was really confused by some error messages. I thought this was just the standard way the REPL handled bullshit XD.