X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Frm%2Fplugins%2Froundcube.rb;h=c25874ef856beda9deda824d0d5d31a77d5fb4a3;hp=a315e77f49b2ec0c9b17c09d228ee55db8fa8459;hb=20b843bddcd73833d41f98ff79d92ef59bb4d81e;hpb=08c59f98a558acd7f166e5382a1b2fec5b57d68c diff --git a/lib/rm/plugins/roundcube.rb b/lib/rm/plugins/roundcube.rb index a315e77..c25874e 100644 --- a/lib/rm/plugins/roundcube.rb +++ b/lib/rm/plugins/roundcube.rb @@ -26,26 +26,14 @@ class RoundcubeRm # This query is of course necessary with any DBMS: sql_queries = ['DELETE FROM users WHERE user_id = $1::int;'] - begin - connection = PGconn.connect(@db_host, - @db_port, - @db_opts, - @db_tty, - @db_name, - @db_user, - @db_pass) - - sql_queries.each do |sql_query| - connection.query(sql_query, [user_id]) - end - - connection.close() - - rescue PGError => e - # Pretend like we're database-agnostic in case we ever are. - raise DatabaseError.new(e) + connection = PGconn.connect(@db_host, @db_port, @db_opts, @db_tty, + @db_name, @db_user, @db_pass) + + sql_queries.each do |sql_query| + connection.query(sql_query, [user_id]) end + connection.close() end end