From 3f739d918f99f0324b9b8ad9ea9c7bd5888c46f7 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Thu, 9 Feb 2012 16:02:41 -0500 Subject: Return errors when connecting fails. --- src/mysqlerl_connection.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mysqlerl_connection.erl b/src/mysqlerl_connection.erl index 46d9fd3..bfff97d 100644 --- a/src/mysqlerl_connection.erl +++ b/src/mysqlerl_connection.erl @@ -37,6 +37,8 @@ init([Owner, Host, Port, Database, User, Password, Options]) -> case send_port_cmd(Ref, ConnectArgs, ?CONNECT_TIMEOUT) of {data, ok} -> {ok, #state{port = Ref, owner = Owner}}; + {data, {error, Error}} -> + {stop, Error}; {'EXIT', Ref, Reason} -> {stop, {port_closed, Reason}} end. -- cgit v1.2.3