lib/knj/knjdb/revision.rb in knjrbfw-0.0.59 vs lib/knj/knjdb/revision.rb in knjrbfw-0.0.62

- old
+ new

@@ -149,21 +149,21 @@ #Change has been made - update cache. cols = table_obj.columns end first_col = false - rescue Knj::Errors::NotFound => e + rescue Errno::ENOENT => e print "Column not found: #{table_obj.name}.#{col_data["name"]}.\n" if args["debug"] if col_data.has_key?("renames") raise "'renames' was not an array for column '#{table_obj.name}.#{col_data["name"]}'." if !col_data["renames"].is_a?(Array) rename_found = false col_data["renames"].each do |col_name| begin col_rename = table_obj.column(col_name) - rescue Knj::Errors::NotFound => e + rescue Errno::ENOENT => e next end print "Rename #{table_obj.name}.#{col_name} to #{table_obj.name}.#{col_data["name"]}\n" if args["debug"] if col_data.is_a?(Hash) and col_data["on_before_rename"] @@ -200,11 +200,11 @@ if table_data["columns_remove"] table_data["columns_remove"].each do |column_name, column_data| begin col_obj = table_obj.column(column_name) - rescue Knj::Errors::NotFound => e + rescue Errno::ENOENT => e next end column_data["callback"].call if column_data.is_a?(Hash) and column_data["callback"] col_obj.drop @@ -225,21 +225,21 @@ if rewrite_index index_obj.drop table_obj.create_indexes([index_data]) end - rescue Knj::Errors::NotFound => e + rescue Errno::ENOENT => e table_obj.create_indexes([index_data]) end end end if table_data["indexes_remove"] table_data["indexes_remove"].each do |index_name, index_data| begin index_obj = table_obj.index(index_name) - rescue Knj::Errors::NotFound => e + rescue Errno::ENOENT => e next end if index_data.is_a?(Hash) and index_data["callback"] index_data["callback"].call if index_data["callback"] @@ -248,18 +248,18 @@ index_obj.drop end end rows_init("db" => db, "table" => table_obj, "rows" => table_data["rows"]) if table_data and table_data["rows"] - rescue Knj::Errors::NotFound => e + rescue Errno::ENOENT => e if table_data.key?("renames") table_data["renames"].each do |table_name_rename| begin table_rename = db.tables[table_name_rename.to_sym] table_rename.rename(table_name) raise Knj::Errors::Retry - rescue Knj::Errors::NotFound + rescue Errno::ENOENT next end end end @@ -290,10 +290,10 @@ schema["tables_remove"].each do |table_name, table_data| begin table_obj = db.tables[table_name.to_sym] table_data["callback"].call("db" => db, "table" => table_obj) if table_data.is_a?(Hash) and table_data["callback"] table_obj.drop - rescue Knj::Errors::NotFound => e + rescue Errno::ENOENT => e next end end end \ No newline at end of file