diff options
author | Brian Cully <bjc@kublai.com> | 2012-02-07 16:16:07 -0500 |
---|---|---|
committer | Brian Cully <github.20.shmit@spamgourmet.com> | 2012-02-07 16:16:07 -0500 |
commit | 12a907609cb3343b3fae60b2b982c3007786e628 (patch) | |
tree | dd533ce8774b4319f5e02ac3fea44705a35b710b /src | |
parent | a9fd65879b539b7ead5f91d8477d488105d64ef6 (diff) | |
download | mysqlerl-12a907609cb3343b3fae60b2b982c3007786e628.tar.gz mysqlerl-12a907609cb3343b3fae60b2b982c3007786e628.zip |
Trap exit on connection and return ok when asked to close.
Diffstat (limited to 'src')
-rw-r--r-- | src/mysqlerl_connection.erl | 5 |
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), |