On Dec 29, 8:20 am, Iñaki Baz Castillo <[email protected]> wrote:
> Hi, if I switch off MySQL server and run Sequel I get:
>
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.5.0/lib/sequel/adapters/mysql.rb:101:in
>  `real_connect':
> Can't connect to MySQL server on 'x.x.x.x' (111) (Mysql::Error)
>         from 
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.5.0/lib/sequel/adapters/mysql.rb:101:in
>  `connect'
>         from 
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.5.0/lib/sequel/database.rb:93:in
>  `block in initialize'
>         from 
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.5.0/lib/sequel/connection_pool.rb:236:in
>  `call'
>         from 
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.5.0/lib/sequel/connection_pool.rb:236:in
>  `hold'
>         from 
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.5.0/lib/sequel/database.rb:482:in
>  `synchronize'
>         from 
> /usr/local/lib/ruby1.9/gems/1.9.1/gems/sequel-3.5.0/lib/sequel/database.rb:505:in
>  `test_connection'
>
> The exception is not rescued by Sequel. Shouldn't it be rescued so I would
> get Sequel::Database::ConnectionError?

It should be rescued by the connection pool (code from the master
branch):

228       begin
229         conn = @connection_proc.call(server)
230       rescue Exception=>exception
231         raise Sequel.convert_exception_class(exception,
Sequel::DatabaseConnectionError)
232       end

Please, if you are going to report issues, post a full backtrace and
the code you are using.  Without looking at your code, I can only
recommend upgrading to 3.7.0 or the master branch to see if the
problem goes away.

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