Bug #5269

All ThreadError in PStore transaction will be caught and replaced with PStore::Error

Added by Glass_saga (Masaki Matsushita) 9 months ago. Updated 2 months ago.

[ruby-core:39238]
Status:Assigned Start date:09/03/2011
Priority:Normal Due date:
Assignee:nahi (Hiroshi Nakamura) % Done:

0%

Category:lib
Target version:2.0.0
ruby -v:ruby 1.9.4dev (2011-09-02 trunk 33165) [x86_64-linux]

Description

I noticed all ThreadError in PStore transaction will be caught and replaced with PStore::Error.

Here is an example:

require 'pstore'

ps = PStore.new("hoge")
ps.transaction do
 raise ThreadError
end

The ThreadError was replaced with PStore::Error.

/usr/local/lib/ruby/1.9.1/pstore.rb:342:in `rescue in transaction': nested transaction (PStore::Error)
       from /usr/local/lib/ruby/1.9.1/pstore.rb:312:in `transaction'
       from pstore_rescue.rb:4:in `<main>'

I wrote and attached a patch. Patched PStore passes in test/test_pstore.rb.

patch.diff (880 Bytes) Glass_saga (Masaki Matsushita), 09/03/2011 11:24 am

patch.diff (922 Bytes) Glass_saga (Masaki Matsushita), 09/23/2011 08:47 pm

History

Updated by Glass_saga (Masaki Matsushita) 8 months ago

I amended the patch. Rescue modifier can't be specified exception class to catch.

Updated by ko1 (Koichi Sasada) 2 months ago

  • Assignee set to nahi (Hiroshi Nakamura)

Updated by shyouhei (Shyouhei Urabe) 2 months ago

  • Status changed from Open to Assigned

Also available in: Atom PDF