Skip to content

Commit

Permalink
Log when failing to close connection
Browse files Browse the repository at this point in the history
  • Loading branch information
mbusi committed May 21, 2024
1 parent 94b9482 commit e9ea055
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/amqp/gen/connection_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ defmodule Amqpx.Gen.ConnectionManager do

def terminate(_, %__MODULE__{connection: connection}) do
if Process.alive?(connection.pid) do
Connection.close(connection)
case Connection.close(connection) do
:ok -> :ok
error -> Logger.warning("Error while closing connection", error: inspect(error))
end
end
end

Expand Down

0 comments on commit e9ea055

Please sign in to comment.