Before Ruby 2.5, if we want to log a caught exception, we would need to format it ourselves. 1class AverageService 2 attr_reader :numbers, :coerced_numbers 3 4 def initialize(numbers) 5 @numbers = numbers 6 @coerced_numbers = coerce_numbers 7 end 8 9 def average 10 sum / count 11 end 12 13 private 14 15 def coerce_numbers 16 numbers.map do |number| 17 begin 18 Float(number) 19 rescue Exception =>