From 12a907609cb3343b3fae60b2b982c3007786e628 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 7 Feb 2012 16:16:07 -0500 Subject: Trap exit on connection and return ok when asked to close. --- src/mysqlerl_connection.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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), -- cgit v1.2.3