On Dec 27, 9:26 am, Iñaki Baz Castillo <[email protected]> wrote:
> Hi, I use Sequel 3.7.0 with mysqlplus. I switch off the MySQL server and run
> a simple query:
>
>   DB[app[:table]].count
>
> The I get an exception not rescued by Sequel:
>
> ------------------
>   Mysql::Error: Can't connect to local MySQL server through socket 
> '/var/run/mysqld/mysqld.sock'
> (2)
>   
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.7.0/lib/sequel/adapters/mysql.rb:110:in
> `real_connect'
>   
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.7.0/lib/sequel/adapters/mysql.rb:110:in
> `connect'
> ------------------

Please always include full backtraces, otherwise it's more difficult
to troubleshoot.  That method (Mysql#real_connect) does raise a
MySQL::Error, but it should be rescued by the connection pool and
converted to a DatabaseConnectionError (unless you are using the
SingleThreadedPool, which doesn't contain the exception conversion
code).

> So I don't understand why it's not rescued. Could it be a bug somewhere?

If you are using the single threaded pool, it's the behavior I would
expect looking at the current code.  I think it's a bug, as the
SingleThreadedPool should operate the same as the standard
ConnectionPool if used in single threaded code.

Jeremy

--

You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.


Reply via email to