Stop pretending that we'll ever work with another DBMS.
[mailshears.git] / lib / rm / plugins / roundcube.rb
index a315e77f49b2ec0c9b17c09d228ee55db8fa8459..c25874ef856beda9deda824d0d5d31a77d5fb4a3 100644 (file)
@@ -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