Hi everyone,

I want to catch an exception on sequel->connect error. When I run the
following code with the mysql DB stopped it keeps executing:

require 'sequel'
DB = Sequel.connect('mysql://user:[email protected]/database')
items = DB[:items]

I don't get ANY exception thrown...but once I ask the DB for data
with:

items.all

Here I get the exception: Sequel::DatabaseConnectionError:
Mysql::Error: Can't connect to MySQL server on '127.0.0.1' (61)

How can I catch the exception when connecting ?
Thanks


Versions:
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
gems (1.3.5)
sequel (3.9.0)
mysql (2.8.1)

-- 
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