4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
|
# File 'lib/widget_list.rb', line 4078
def generate_error_output(ex='')
sqlDebug = ""
if !@items['errors'].empty?
sqlDebug += "<br/><br/><strong style='color:red'>(" + @items['errors'].join(', ') + ")</strong>"
end
if Rails.env == 'development'
sqlDebug += "<br/><br/><textarea style='width:100%;height:400px;'>" + get_database.last_sql.to_s + "</textarea>"
end
if Rails.env == 'development' && get_database.errors
sqlDebug += "<br/><br/><strong style='color:red'>(" + get_database.last_error.to_s + ")</strong>"
end
if Rails.env == 'development' && ex != ''
sqlDebug += "<br/><br/><strong style='color:red'>(" + ex.to_s + ") <pre>" + $!.backtrace.join("\n\n") + "</pre></strong>"
end
if Rails.env != 'development'
if get_database.errors
Rails.logger.info get_database.last_error.to_s
end
if ex != ''
Rails.logger.info $!.backtrace.join("\n\n")
end
end
Rails.logger.info sqlDebug
sqlDebug
end
|