From e8cbda45326450196ee40e7df0de962aad936541 Mon Sep 17 00:00:00 2001 From: Greg Rychlewski Date: Fri, 26 Jul 2024 07:47:00 -0400 Subject: [PATCH] fix :stop return from gen_statem --- lib/postgrex/replication_connection.ex | 2 +- lib/postgrex/simple_connection.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/postgrex/replication_connection.ex b/lib/postgrex/replication_connection.ex index 8fcde20c..8bb93339 100644 --- a/lib/postgrex/replication_connection.ex +++ b/lib/postgrex/replication_connection.ex @@ -474,7 +474,7 @@ defmodule Postgrex.ReplicationConnection do case handle_event(:internal, {:connect, :init}, @state, state) do {:keep_state, state} -> {:ok, @state, state} {:keep_state, state, actions} -> {:ok, @state, state, actions} - {:stop, _reason, _state} = stop -> stop + {:stop, reason, _state} -> {:stop, reason} end else {:ok, @state, state, {:next_event, :internal, {:connect, :init}}} diff --git a/lib/postgrex/simple_connection.ex b/lib/postgrex/simple_connection.ex index 62ac8fae..abb16d93 100644 --- a/lib/postgrex/simple_connection.ex +++ b/lib/postgrex/simple_connection.ex @@ -325,7 +325,7 @@ defmodule Postgrex.SimpleConnection do case handle_event(:internal, {:connect, :init}, @state, state) do {:keep_state, state} -> {:ok, @state, state} {:keep_state, state, actions} -> {:ok, @state, state, actions} - {:stop, _reason, _state} = stop -> stop + {:stop, reason, _state} -> {:stop, reason} end else {:ok, @state, state, {:next_event, :internal, {:connect, :init}}}