aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2012-02-07 16:16:07 -0500
committerBrian Cully <github.20.shmit@spamgourmet.com>2012-02-07 16:16:07 -0500
commit12a907609cb3343b3fae60b2b982c3007786e628 (patch)
treedd533ce8774b4319f5e02ac3fea44705a35b710b
parenta9fd65879b539b7ead5f91d8477d488105d64ef6 (diff)
downloadmysqlerl-12a907609cb3343b3fae60b2b982c3007786e628.tar.gz
mysqlerl-12a907609cb3343b3fae60b2b982c3007786e628.zip
Trap exit on connection and return ok when asked to close.
-rw-r--r--src/mysqlerl_connection.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mysqlerl_connection.erl b/src/mysqlerl_connection.erl
index 1a3d900..aa49c7e 100644
--- a/src/mysqlerl_connection.erl
+++ b/src/mysqlerl_connection.erl
@@ -18,7 +18,10 @@ start_link(Owner, Host, Port, Database, User, Password, Options) ->
User, Password, Options], []).
stop(Pid) ->
- gen_server:call(Pid, stop).
+ case (catch gen_server:call(Pid, stop)) of
+ {'EXIT', _} -> ok;
+ Other -> Other
+ end.
init([Owner, Host, Port, Database, User, Password, Options]) ->
process_flag(trap_exit, true),