1行で書く場合は$!で例外オブジェクトを取得できますね。 その他 その他の例外関連はこちらなどを参考に http://www.namaraii.com/rubytips/?%E4%BE%8B%E5%A4%96 Register as a new user and use Qiita more conveniently You get articles that match your needsYou can efficiently read back useful informationYou can use dark themeWhat you can do with signing up