handle connection failure error

V

Vetrivel Vetrivel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top