From 1b94a289b1690c5f0bbfa7fe072d23170980f7b9 Mon Sep 17 00:00:00 2001 From: Lukasz Samson Date: Fri, 8 Jan 2021 22:03:58 +0100 Subject: [PATCH] rescue MatchError in :int calls Fixes #455 --- .../elixir_ls_debugger/lib/debugger/server.ex | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/elixir_ls_debugger/lib/debugger/server.ex b/apps/elixir_ls_debugger/lib/debugger/server.ex index d55828696..b08307490 100644 --- a/apps/elixir_ls_debugger/lib/debugger/server.ex +++ b/apps/elixir_ls_debugger/lib/debugger/server.ex @@ -341,7 +341,12 @@ defmodule ElixirLS.Debugger.Server do pid = state.threads[thread_id] state = remove_paused_process(state, pid) - :int.next(pid) + try do + :int.next(pid) + rescue + e in MatchError -> + IO.warn ":int.next failed, #{Exception.message(e)}" + end {%{}, state} end @@ -349,7 +354,12 @@ defmodule ElixirLS.Debugger.Server do pid = state.threads[thread_id] state = remove_paused_process(state, pid) - :int.step(pid) + try do + :int.step(pid) + rescue + e in MatchError -> + IO.warn ":int.step failed, #{Exception.message(e)}" + end {%{}, state} end @@ -357,7 +367,12 @@ defmodule ElixirLS.Debugger.Server do pid = state.threads[thread_id] state = remove_paused_process(state, pid) - :int.finish(pid) + try do + :int.finish(pid) + rescue + e in MatchError -> + IO.warn ":int.finish failed, #{Exception.message(e)}" + end {%{}, state} end