別のキーワード
種類
- インスタンスメソッド (264)
- モジュール関数 (246)
- 特異メソッド (228)
ライブラリ
- ビルトイン (463)
- bigdecimal (38)
- e2mmap (78)
- fileutils (24)
- irb (12)
-
json
/ add / exception (24) -
minitest
/ unit (2) -
rubygems
/ commands / lock _ command (12) -
rubygems
/ security (24) -
rubygems
/ spec _ fetcher (12) - stringio (12)
- timeout (37)
クラス
-
ARGF
. class (10) - BigDecimal (24)
- Exception (104)
- Fiber (18)
-
Gem
:: Commands :: LockCommand (12) -
Gem
:: Security :: Policy (12) -
Gem
:: SpecFetcher (12) - IO (24)
-
MiniTest
:: Unit (1) - SignalException (36)
- StringIO (12)
- Thread (96)
- TracePoint (12)
モジュール
- Exception2MessageMapper (78)
- FileUtils (24)
-
Gem
:: Security (12) - IRB (12)
- Kernel (217)
-
MiniTest
:: Assertions (1) - Timeout (21)
キーワード
- == (12)
- BigDecimal (14)
- Complex (14)
- Fail (12)
- Float (7)
- Integer (7)
- Raise (12)
- Rational (7)
- abort (24)
-
abort
_ on _ exception (24) -
abort
_ on _ exception= (24) - bind (6)
- complain (12)
-
def
_ exception (12) -
exception
_ details (1) -
extend
_ object (6) - fail (42)
-
handle
_ interrupt (12) -
irb
_ abort (12) -
json
_ create (12) - mode (24)
- new (60)
- puke (1)
- raise (54)
-
read
_ nonblock (34) - remove (12)
-
report
_ on _ exception (18) -
report
_ on _ exception= (18) - rm (12)
-
set
_ backtrace (12) - spawn (28)
- system (28)
- timeout (37)
-
to
_ json (12) -
verify
_ gem (12) -
verify
_ trust _ dir (12) -
warn
_ legacy (12) -
write
_ nonblock (12)
検索結果
先頭5件
-
Exception
. exception(error _ message = nil) -> Exception (27245.0) -
例外オブジェクトを生成して返します。
...します。
@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
//emlist[例][ruby]{
e = Exception.new("some messag......e")
p e # => #<Exception: some message>
p e.message # => "some message"
//}
//emlist[例][ruby]{
e = Exception.exception("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
//}... -
Exception
# exception(error _ message) -> Exception (27237.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列......を指定します。
//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
Exception
# exception -> self (27137.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列......を指定します。
//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
Exception
. new(error _ message = nil) -> Exception (12145.0) -
例外オブジェクトを生成して返します。
...します。
@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
//emlist[例][ruby]{
e = Exception.new("some messag......e")
p e # => #<Exception: some message>
p e.message # => "some message"
//}
//emlist[例][ruby]{
e = Exception.exception("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
//}... -
Exception2MessageMapper
. def _ exception(klass , exception _ name , message _ format , superklass = StandardError) -> Class (9248.0) -
exception_name という名前の例外クラスを定義します。
...
exception_name という名前の例外クラスを定義します。
@param klass 一階層上となるクラス名を指定します。
@param exception_name 例外クラスの名前をシンボルで指定します。
@param message_format メッセージのフォーマットを指定しま......す。
Kernel.#sprintf のフォーマット文字列と同じ形式を使用できます。
@param superklass 定義する例外クラスのスーパークラスを指定します。
省略すると StandardError を使用します。
@return 定義した例... -
Exception2MessageMapper
# def _ exception(exception _ name , message _ format , superclass = StandardError) -> Class (9242.0) -
exception_name という名前の例外クラスを定義します。
...
exception_name という名前の例外クラスを定義します。
@param exception_name 定義する例外クラスの名前をシンボルで指定します。
@param message_format メッセージのフォーマット。
@param superclass 定義する例外のスーパークラスを指定... -
Exception
. json _ create(hash) -> Exception (9107.0) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
...JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。... -
Exception
# ==(other) -> bool (9030.0) -
自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。
...そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。
自身と異なるクラスのオブジェクトを指定した場合は
Exception#exception を実行して変換を試みます。
//emlist[例......eturn if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
results = [2, 2, 4].map { |e | get_exception { check_long_month(e) } }
p results.map { |e| e.class }
# => [RuntimeError, RuntimeError, Runt... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (9030.0) -
例外の整形された文字列を返します。
...order は 2.5.1 で追加されました。
@param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。
@param order :top か :bottom で指定する必要......バックトレースの一番奥がエラーメッセージの上(top)か下(bottom)かを指定します。
デフォルト値は Exception.to_tty? が真なら :bottom で偽なら :top です。
//emlist[例][ruby]{
begin
raise "test"
rescue => e
p e.full_message # => "\e[1m......e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
end
//}
@see Exception.to_tty?......よる文字装飾がついています。
@param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。
@param order :top か :bottom で指定する必要... -
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (9006.0) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
...バックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。
@param errinfo nil、String あるいは String の配列のいずれかを指定します。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
r...