るりまサーチ

最速Rubyリファレンスマニュアル検索!
27件ヒット [1-27件を表示] (0.005秒)
トップページ > クラス:Exception[x] > ライブラリ:ビルトイン[x]

キーワード

検索結果

Exception#==(other) -> bool (3)

自身と指定された other のクラスが同じであり、message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。

自身と指定された other のクラスが同じであり、message と backtrace が == メソッドで比較して
等しい場合に true を返します。そうでない場合に false を返します。

@param other 自身と比較したいオブジェクトを指定します。

Exception#backtrace -> [String] (3)

バックトレース情報を返します。

バックトレース情報を返します。

デフォルトでは

* "#{sourcefile}:#{sourceline}:in `#{method}'"
(メソッド内の場合)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)

という形式の String の配列です。

def methd
raise
end

begin
methd
rescue => e
p e.backtrace
end

#=> ["filename.rb:2:in `methd'", "filename.rb:6"]

Exception#exception -> self (3)

引数を指定しない場合は 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(error_message) -> Exception (3)

引数を指定しない場合は 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#message -> String (3)

エラーメッセージをあらわす文字列を返します。

エラーメッセージをあらわす文字列を返します。

begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end

絞り込み条件を変える

Exception#set_backtrace(errinfo) -> nil | String | [String] (3)

バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。

バックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。

@param errinfo nil、String あるいは String の配列のいずれかを指定します。

Exception#to_s -> String (3)

エラーメッセージをあらわす文字列を返します。

エラーメッセージをあらわす文字列を返します。

begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end

Exception#to_str -> String (3)

エラーメッセージをあらわす文字列を返します。

エラーメッセージをあらわす文字列を返します。

begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end

Exception.exception(error_message = nil) (3)

例外オブジェクトを生成して返します。

...す。

@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。...

Exception.new(error_message = nil) (3)

例外オブジェクトを生成して返します。

...す。

@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。...

絞り込み条件を変える