481件ヒット
[101-200件を表示]
(0.116秒)
別のキーワード
ライブラリ
- ビルトイン (270)
- bigdecimal (12)
- drb (12)
- e2mmap (36)
- json (12)
-
json
/ add / exception (12) -
minitest
/ unit (3) -
net
/ http (12) - rexml (48)
-
rubygems
/ commands / lock _ command (12) -
rubygems
/ security (12) -
rubygems
/ spec _ fetcher (12) - stringio (12)
- timeout (16)
クラス
-
ARGF
. class (10) - BigDecimal (12)
-
DRb
:: DRbUnknown (12) -
Encoding
:: Converter (12) - Exception (140)
- Fiber (18)
-
Gem
:: Commands :: LockCommand (12) -
Gem
:: Security :: Policy (12) -
Gem
:: SpecFetcher (12) - IO (24)
-
JSON
:: State (12) -
MiniTest
:: Unit (2) -
REXML
:: ParseException (48) - SignalException (24)
- StringIO (12)
- Thread (42)
- TracePoint (12)
モジュール
- Exception2MessageMapper (36)
- Kernel (16)
-
MiniTest
:: Assertions (1) -
Net
:: HTTPExceptions (12)
キーワード
- == (12)
- Fail (6)
- Raise (6)
-
abort
_ on _ exception (12) -
abort
_ on _ exception= (12) - backtrace (12)
-
backtrace
_ locations (12) - bind (6)
- cause (12)
- complain (12)
- context (12)
-
def
_ exception (6) -
exception
_ details (1) - fail (6)
- generate (12)
- inspect (12)
-
last
_ error (12) - line (12)
- location (1)
- position (12)
- puke (1)
- raise (18)
-
raised
_ exception (12) -
read
_ nonblock (34) -
report
_ on _ exception (9) -
report
_ on _ exception= (9) - response (12)
-
save
_ exception _ mode (12) -
set
_ backtrace (12) - signm (12)
- signo (12)
- timeout (16)
-
to
_ json (12) -
to
_ s (24) -
verify
_ gem (12) -
warn
_ legacy (12) -
write
_ nonblock (12)
検索結果
先頭5件
-
Exception
# backtrace -> [String] (9007.0) -
バックトレース情報を返します。
...)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)
という形式の String の配列です。
//emlist[例][ruby]{
def methd
raise
end
begin
methd
rescue => e
p e.backtrace
end
#=> ["filename.rb:2:in `methd'", "filename.rb:6"]
//}
@see Exception#backtrace_locations... -
Exception
# message -> String (9001.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//} -
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (9001.0) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
バックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。
@param errinfo nil、String あるいは String の配列のいずれかを指定します。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
$!.backtrace # => ["/path/to/test.rb:5:in `rescue in <main>'", "/path/to/test.rb:2:in `<main>'"]
$!.se... -
Exception
# to _ json(*args) -> String (9001.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivis... -
Exception
# to _ s -> String (9001.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//} -
MiniTest
:: Assertions # exception _ details(exception , message) -> String (6209.0) -
与えられた例外の詳細を文字列として返します。
...与えられた例外の詳細を文字列として返します。
@param exception 例外を指定します。
@param message メッセージを指定します。... -
TracePoint
# raised _ exception -> Exception (6209.0) -
発生した例外を返します。
...eError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace.enable
begin
0/0
rescue
end
//}... -
Thread
# report _ on _ exception -> bool (6151.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...d.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => tru......irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Th......read:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# report _ on _ exception=(newstate) (6151.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...d.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => tru......irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Th......read:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# abort _ on _ exception -> bool (6127.0) -
真の場合、そのスレッドが例外によって終了した時に、インタプリタ 全体を中断させます。false の場合、あるスレッドで起こった例 外は、Thread#join などで検出されない限りそのスレッ ドだけをなにも警告を出さずに終了させます。
...c:Thread#exceptionを参照してください。
@param newstate 自身を実行中に例外発生した場合、インタプリタ全体を終了させるかどうかを true か false で指定します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.abort_on_exception # => false......thread.abort_on_exception = true
thread.abort_on_exception # => true
//}...