Handle connection failure error

doubt in Postgres module in ruby .

using PGConn i connect with database . Then I executed one query .

def executeSql
         query1= "select * from user_info ;

         begin
           obj.query( query1 )

         rescue PGError => e

         end

end

My problem is that , if there is a query error , i will rescue that
error and i go ahead . But if there is a connection error , i want to
exit the process . How do i find out whether it is a connection error
and query error . Is there any Exception handling for connection error
in ruyu

Thanks

···

--
Posted via http://www.ruby-forum.com/.