193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
# File 'lib/mac_bacon.rb', line 193
def execute_block
begin
yield
rescue Object => e
@exception_occurred = true
ErrorLog << "#{e.class}: #{e.message}\n"
e.backtrace.find_all { |line| line !~ /bin\/bacon|\/bacon\.rb:\d+/ }.
each_with_index { |line, i|
ErrorLog << "\t#{line}#{i==0 ? ": #{@context.name} - #{@description}" : ""}\n"
}
ErrorLog << "\n"
@error = if e.kind_of? Error
Counter[e.count_as] += 1
e.count_as.to_s.upcase
else
Counter[:errors] += 1
"ERROR: #{e.class}"
end
end
end
|