948件ヒット
[1-100件を表示]
(0.129秒)
別のキーワード
種類
ライブラリ
- ビルトイン (362)
- bigdecimal (124)
- e2mmap (96)
- json (12)
-
json
/ add / exception (12) - matrix (12)
-
minitest
/ unit (4) - rexml (48)
-
rubygems
/ commands / lock _ command (12) -
rubygems
/ exceptions (108) -
rubygems
/ gem _ openssl (12) -
rubygems
/ security (36) -
rubygems
/ spec _ fetcher (12) - stringio (12)
- timeout (9)
クラス
-
ARGF
. class (10) - BigDecimal (110)
-
Encoding
:: Converter (12) - Exception (116)
- Fiber (12)
-
Gem
:: Commands :: LockCommand (12) -
Gem
:: Security :: Policy (12) -
Gem
:: SpecFetcher (12) - IO (24)
-
JSON
:: State (12) -
MiniTest
:: Unit (2) -
MiniTest
:: Unit :: TestCase (1) -
REXML
:: ParseException (48) - SignalException (60)
- StringIO (12)
モジュール
- Exception2MessageMapper (78)
- Gem (12)
-
Gem
:: Security (12) - Kernel (142)
-
MiniTest
:: Assertions (1) - Timeout (9)
キーワード
-
$ DEBUG (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - BigDecimal (14)
- DependencyRemovalException (12)
- E2MM (6)
-
EXCEPTION
_ ALL (12) -
EXCEPTION
_ INFINITY (12) -
EXCEPTION
_ NaN (12) -
EXCEPTION
_ OVERFLOW (12) -
EXCEPTION
_ UNDERFLOW (12) -
EXCEPTION
_ ZERODIVIDE (12) - EndOfYAMLException (12)
- ErrNotRegisteredException (6)
- ErrNotRegular (12)
- Exception2MessageMapper (6)
- Fail (12)
- Float (7)
- FormatException (12)
- GemNotFoundException (12)
- GemNotInHomeException (12)
- Integer (7)
- InvalidSpecificationException (12)
-
NEWS for Ruby 3
. 0 . 0 (5) -
PASSTHROUGH
_ EXCEPTIONS (1) - Raise (12)
- RemoteSourceException (12)
- Ruby用語集 (12)
- SignalException (12)
- SystemExitException (12)
- abort (12)
- backtrace (12)
- bind (6)
- complain (12)
- context (12)
- debug (12)
-
def
_ exception (12) -
ensure
_ ssl _ available (12) - exception (24)
-
exception
_ details (1) -
extend
_ object (6) - fail (30)
- generate (12)
- inspect (12)
-
last
_ error (12) - line (12)
- location (1)
- logger (12)
- mode (24)
- new (50)
- position (12)
- puke (1)
- raise (36)
-
read
_ nonblock (34) -
ruby 1
. 6 feature (12) -
rubygems
/ exceptions (12) -
save
_ exception _ mode (12) -
set
_ backtrace (12) - signm (12)
- signo (12)
- spawn (28)
- system (14)
- timeout (9)
-
to
_ json (12) -
to
_ s (24) -
verify
_ gem (12) -
verify
_ trust _ dir (12) -
warn
_ legacy (12) -
write
_ nonblock (12)
検索結果
先頭5件
-
Exception
. exception(error _ message = nil) -> Exception (27339.0) -
例外オブジェクトを生成して返します。
...ge エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
//emlist[例][ruby]{
e = Exception.new("some message")
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 (27331.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
# full _ message(highlight: true , order: :bottom) -> String (27118.0) -
例外の整形された文字列を返します。
...て実際に、キーワード引数 highlight と order は 2.5.1 で追加されました。
@param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。
@......(top)か下(bottom)かを指定します。
デフォルト値は Exception.to_tty? が真なら :bottom で偽なら :top です。
//emlist[例][ruby]{
begin
raise "test"
rescue => e
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1......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
# message -> String (27100.0) -
エラーメッセージをあらわす文字列を返します。
...エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}... -
Exception
. new(error _ message = nil) -> Exception (24239.0) -
例外オブジェクトを生成して返します。
...ge エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
//emlist[例][ruby]{
e = Exception.new("some message")
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
# to _ s -> String (24100.0) -
エラーメッセージをあらわす文字列を返します。
...エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}... -
Ruby用語集 (23052.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......sed
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まること。
例えば、
エラ......る。
また、例外オブジェクトは例外が発生した時点までのスタックトレースを保持しており、
Exception#backtrace や Exception#backtrace_locations で
取り出すことができる。
: スーパークラス
: superclass
クラス B がクラス A のサ... -
Exception
# inspect -> String (21112.0) -
self のクラス名と message を文字列にして返します。
...self のクラス名と message を文字列にして返します。
//emlist[例][ruby]{
begin
raise "exception"
rescue
p $!.inspect # => "#<RuntimeError: exception>"
end
//}... -
Exception
# backtrace -> [String] (21106.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...