Skip to content

Commit

Permalink
rescue MatchError in :int calls
Browse files Browse the repository at this point in the history
Fixes #455
  • Loading branch information
lukaszsamson committed Jan 8, 2021
1 parent 35dc021 commit 1b94a28
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions apps/elixir_ls_debugger/lib/debugger/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -341,23 +341,38 @@ 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

defp handle_request(step_in_req(_, thread_id), state) 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

defp handle_request(step_out_req(_, thread_id), state) 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

Expand Down

0 comments on commit 1b94a28

Please sign in to comment.