From b3db42c1fb57a879a2c76a44db38e6916598ad2c Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 10 Jan 2022 09:21:08 -0500 Subject: [PATCH] [REPL] handle failure of edit call gracefully (#43690) --- stdlib/REPL/src/REPL.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/REPL/src/REPL.jl b/stdlib/REPL/src/REPL.jl index 1552001b5ffed3..26e3faa04070fd 100644 --- a/stdlib/REPL/src/REPL.jl +++ b/stdlib/REPL/src/REPL.jl @@ -1202,7 +1202,12 @@ function setup_interface( if n <= 0 || n > length(linfos) || startswith(linfos[n][1], "REPL[") @goto writeback end - InteractiveUtils.edit(linfos[n][1], linfos[n][2]) + try + InteractiveUtils.edit(linfos[n][1], linfos[n][2]) + catch ex + ex isa ProcessFailedException || ex isa Base.IOError || ex isa SystemError || rethrow() + @info "edit failed" _exception=ex + end LineEdit.refresh_line(s) return @label writeback