Skip to content

Commit

Permalink
Respond with nil instead of an error when formatting fails (#411)
Browse files Browse the repository at this point in the history
Responding with an error can cause clients to display a pop-up or other
notification of the failed request. This can be annoying, however,
because diagnostics from the failure will already be displayed.
  • Loading branch information
zachallaun authored Oct 12, 2023
1 parent aa1de2d commit ac6b6bd
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ defmodule Lexical.Server.Provider.Handlers.Formatting do

{:error, reason} ->
Logger.error("Formatter failed #{inspect(reason)}")

{:reply, Responses.Formatting.error(request.id, :request_failed, inspect(reason))}
{:reply, Responses.Formatting.new(request.id, nil)}
end
end
end

0 comments on commit ac6b6bd

Please sign in to comment.