When something goes wrong in Rails and you do something that causes an exception to be raised, Rails normally calls a method called rescue_action_in_public if your site is in production giving you the familiar generic Rails error code. If you’re in development, Rails calls rescue_action_locally giving you that handy, if somewhat ugly stack-trace. This is usually pretty servicable, but what if you
Running a rails site right now using SQLite3. About once every 500 requests or so, I get a ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked:... What's the way to fix this that would be minimally invasive to my code? I'm using SQLLite at the moment because you can store the DB in source control which makes backing up natural and you can push changes out very quickly. Howev
Net::HTTPは内部でTimeoutを利用しているけども、これのエラー補足までの面倒は見てくれない。 なので必ずrescueで補足してあげる必要がある。 begin Net::HTTP.get(url) rescue puts "exception on HTTP: #{$!}" end ・・・と安直にやりたいところだけれど、ここに落とし穴。 実際にHTTP通信がタイムアウトを起こすとこうなってしまう。 /usr/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error) 引数無しのrescueはStandardErrorとそのサブクラスしか受け付けてくれない。 error_type が省略された時は StandardError のサブクラスである全ての例外を捕捉します。 プログラミング言語
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く