Stop pretending that we'll ever work with another DBMS.
[mailshears.git] / lib / mv / plugins / davical.rb
index bd66df8bd8d979a3dd6aa74c4fed6f43a658deaf..20c8a32af50d668fe8ccba1f690091cbddcafe9a 100644 (file)
@@ -27,26 +27,14 @@ class DavicalMv
 
     sql_queries = ['UPDATE usr SET username = $1 WHERE username = $2']
 
-    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, [dst.to_s(), src.to_s()])
-      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, [dst.to_s(), src.to_s()])
     end
 
+    connection.close()
   end
 
 end