0
0

More than 1 year has passed since last update.

【Rails】例外処理raise

Posted at

環境

Ruby 3.0.2
Rails 6.1.4.1

引数にメッセージのみ指定すると初期値のRuntimeErrorが発生する

raise 'error message'

第1引数に例外クラス、第2引数にエラメッセージを指定できる

raise NoMethodError, 'error message'

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0