aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2012-02-09 16:02:41 -0500
committerBrian Cully <bjc@kublai.com>2012-02-09 16:02:41 -0500
commit3f739d918f99f0324b9b8ad9ea9c7bd5888c46f7 (patch)
tree21801e8e8bcf7f45a52bbf1509c4f07441c45251 /src
parentb9892e56efff45f76d505337fc03f3e04f7c6073 (diff)
downloadmysqlerl-3f739d918f99f0324b9b8ad9ea9c7bd5888c46f7.tar.gz
mysqlerl-3f739d918f99f0324b9b8ad9ea9c7bd5888c46f7.zip
Return errors when connecting fails.
Diffstat (limited to 'src')
-rw-r--r--src/mysqlerl_connection.erl2
1 files changed, 2 insertions, 0 deletions
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.