class DataAnon::Core::TableErrors
Public Class Methods
new(table_name)
click to toggle source
# File lib/core/table_errors.rb, line 7 def initialize table_name @table_name = table_name @errors = [] end
Public Instance Methods
errors()
click to toggle source
# File lib/core/table_errors.rb, line 17 def errors @errors end
log_error(record, exception)
click to toggle source
# File lib/core/table_errors.rb, line 12 def log_error record, exception @errors << { :record => record, :exception => exception} raise 'Reached limit of error for a table' if @errors.length > 100 end
print()
click to toggle source
# File lib/core/table_errors.rb, line 21 def print return if @errors.length == 0 logger.error("Errors while processing table '#{@table_name}':") @errors.each do |error| logger.error(error[:exception]) logger.error(error[:exception].backtrace.join("\n\t")) end end