Skip to content

Commit

Permalink
show error message when replication connection failed to establish a …
Browse files Browse the repository at this point in the history
…connection
  • Loading branch information
DohanKim committed Jan 22, 2025
1 parent f023e67 commit 19ab39b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/postgrex/replication_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ defmodule Postgrex.ReplicationConnection do
maybe_handle(mod, :handle_connect, [mod_state], %{s | protocol: protocol})

{:error, reason} ->
Logger.error(
"#{inspect(pid_or_name())} (#{inspect(mod)}) failed to connect to Postgres: #{Exception.format(:error, reason)}"
)

if s.auto_reconnect do
{:keep_state, s, {{:timeout, :backoff}, s.reconnect_backoff, nil}}
else
Expand Down
Binary file added test/.DS_Store
Binary file not shown.

0 comments on commit 19ab39b

Please sign in to comment.