エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Ruby 2.5 adds Exception#full_message method
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Ruby 2.5 adds Exception#full_message method
Before Ruby 2.5, if we want to log a caught exception, we would need to formatit ourselves. class... Before Ruby 2.5, if we want to log a caught exception, we would need to formatit ourselves. class AverageService attr_reader :numbers, :coerced_numbers def initialize(numbers) @numbers = numbers @coerced_numbers = coerce_numbers end def average sum / count end private def coerce_numbers numbers.map do |number| begin Float(number) rescue Exception => exception puts "#{exception.message} (#{exceptio

