るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.026秒)
トップページ > クエリ:Exception[x] > クエリ:HTTPExceptions[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin exception
  2. exception exception
  3. thread abort_on_exception=
  4. thread abort_on_exception
  5. _builtin abort_on_exception=

ライブラリ

モジュール

検索結果

Net::HTTPExceptions#response -> Net::HTTPResponse (6001.0)

例外の原因となったレスポンスオブジェクトを返します。

例外の原因となったレスポンスオブジェクトを返します。

//emlist[例][ruby]{
require 'net/http'

uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.response # => #<Net::HTTPNotFound 404 Not Found readbody=true>
end
//}