Defect #273

Internal error occurs when hudson has no response.

Added by Haru Iida about 2 years ago. Updated almost 2 years ago.

Status:終了(Closed) Start date:01/11/2010
Priority:通常(Normal) Due date:
Assignee:Toshiyuki Ando % Done:

100%

Category:- Spent time: -
Target version:1.0.2

Description

Hudsonが重くて応答が無い場合、HudsonプラグインでInternal Errorが発生します。

Timeout::Error (execution expired):
    /usr/local/lib/ruby/1.8/timeout.rb:60:in `rbuf_fill'
    /usr/local/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
    /usr/local/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
    /usr/local/lib/ruby/1.8/net/protocol.rb:126:in `readline'
    /usr/local/lib/ruby/1.8/net/http.rb:2020:in `read_status_line'
    /usr/local/lib/ruby/1.8/net/http.rb:2009:in `read_new'
    /usr/local/lib/ruby/1.8/net/http.rb:1050:in `request'
    /usr/local/lib/ruby/1.8/net/http.rb:1037:in `request'
    /usr/local/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/local/lib/ruby/1.8/net/http.rb:1035:in `request'
    /vendor/plugins/redmine_hudson/app/helpers/hudson_helper.rb:16:in
`open_hudson_api'

Associated revisions

Revision 416
Added by Toshiyuki Ando about 2 years ago

fixes #273
specify error class

History

Updated by Toshiyuki Ando about 2 years ago

うーん。

    begin
      response = http.request(request)
    rescue => error
      raise HudsonApiException.new(error)
    end

ではキャッチできないらしい。ちょっとググってみたら…。

◆Timeout::Error に注意
http://d.hatena.ne.jp/dreammind/20090217/1234813224

  • rescueはエラータイプを省略するとStandartErrorのサブクラスの例外を捕捉する
  • Timeout::ErrorはInterruptを継承したクラスでStanderErrorには属していない

気をつけねば…。

Updated by Toshiyuki Ando about 2 years ago

  • Status changed from 新規(New) to 解決(Resolved)
  • % Done changed from 0 to 100

更新履歴 r416 で適用されました。

Updated by Toshiyuki Ando about 2 years ago

  • Target version set to 1.0.2

Updated by Toshiyuki Ando almost 2 years ago

  • Status changed from 解決(Resolved) to 終了(Closed)

Also available in: Atom PDF