Bug #5269

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

Added by Masaki Matsushita almost 4 years ago. Updated almost 3 years ago.

[ruby-core:39238]
Status:Closed
Priority:Normal
Assignee:Hiroshi Nakamura
ruby -v:ruby 1.9.4dev (2011-09-02 trunk 33165) [x86_64-linux] Backport:

Description

=begin
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 `'

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

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

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

Associated revisions

Revision 37617
Added by glass almost 3 years ago

  • lib/pstore.rb (PStore): fix not to replace ThreadError raised in #transaction block with PStore::Error. [Bug #5269]

Revision 37617
Added by glass almost 3 years ago

  • lib/pstore.rb (PStore): fix not to replace ThreadError raised in #transaction block with PStore::Error. [Bug #5269]

History

#1 Updated by Masaki Matsushita almost 4 years ago

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

#2 Updated by Koichi Sasada over 3 years ago

  • Assignee set to Hiroshi Nakamura

#3 Updated by Shyouhei Urabe over 3 years ago

  • Status changed from Open to Assigned

#4 Updated by Anonymous almost 3 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37617.
Masaki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/pstore.rb (PStore): fix not to replace ThreadError raised in #transaction block with PStore::Error. [Bug #5269]

Also available in: Atom PDF