8件ヒット
[1-8件を表示]
(0.024秒)
別のキーワード
種類
- インスタンスメソッド (6)
- 特異メソッド (2)
ライブラリ
- ビルトイン (8)
検索結果
先頭5件
-
Exception
# message -> String (62109.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end -
Exception
# to _ s -> String (47009.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end -
Exception
. exception(error _ message = nil) -> Exception (27409.0) -
例外オブジェクトを生成して返します。
... Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
例:
e = Exception.new("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
例:
e = Exception.exception("some message")
p e # => #<Exception:... -
Exception
# exception(error _ message) -> Exception (27388.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...lf を返します。引数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセ......ージを表す文字列を指定します。
begin
... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end... -
Exception
# exception -> self (27188.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...lf を返します。引数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセ......ージを表す文字列を指定します。
begin
... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end... -
Exception
. new(error _ message = nil) -> Exception (24309.0) -
例外オブジェクトを生成して返します。
... Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
例:
e = Exception.new("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
例:
e = Exception.exception("some message")
p e # => #<Exception:... -
Exception
# ==(other) -> bool (21030.0) -
自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。
...ます。そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。
自身と異なるクラスのオブジェクトを指定した場合は
Exception#exception を実行して変換を試みます。... -
Exception
# inspect -> String (21030.0) -
self のクラス名と message を文字列にして返します。
...self のクラス名と message を文字列にして返します。
例:
begin
raise "exception"
rescue
p $!.inspect # => "#<RuntimeError: exception>"
end...