Skip to content

Commit

Permalink
make sure logging is not crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Feb 27, 2024
1 parent 4da5c49 commit 885a63f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/elixir_sense/core/normalized/code/fragment.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ defmodule ElixirSense.Core.Normalized.Code.Fragment do
rescue
e ->
if Version.match?(System.version(), ">= 1.16.0-dev") do
Logger.error(
"Code.Fragment.container_cursor_to_quoted raised #{Exception.blame(:error, e, __STACKTRACE__)}. Please report that to elixir project."
)
try do
Logger.error(
"Code.Fragment.container_cursor_to_quoted raised #{Exception.blame(:error, e, __STACKTRACE__)}. Please report that to elixir project."
)
rescue
_ -> :ok
end

reraise e, __STACKTRACE__
else
Expand Down

0 comments on commit 885a63f

Please sign in to comment.