[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
SXNzdWUgIzExMjYyIGhhcyBiZWVuIHVwZGF0ZWQgYnkgSsO2cmcgVyBNaXR0YWcuCgpQcm9qZWN0
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
SXNzdWUgIzEyMTAzIGhhcyBiZWVuIHVwZGF0ZWQgYnkgTWFydGluIETDvHJzdC4KClN0YXR1cyBj
3 messages
2016/02/27
[ruby-core:73798] [Ruby trunk Bug#12068] raise overwrites exception cause even if exception is not new
From:
nobu@...
Date:
2016-02-14 04:21:47 UTC
List:
ruby-core #73798
Issue #12068 has been updated by Nobuyoshi Nakada.
In JRuby, `cause` is set just in `initialize`?
```
$ jruby -v -e 'raise "a" rescue p RuntimeError.new("b").cause'
jruby 9.1.0.0-SNAPSHOT (2.2.3) 2016-02-14 c08ca7a Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b17 +jit [darwin-x86_64]
#<RuntimeError: a>
```
```
$ ruby -v -e 'raise "a" rescue p RuntimeError.new("b").cause'
ruby 2.4.0dev (2016-02-13 trunk 53817) [universal.x86_64-darwin15]
nil
```
----------------------------------------
Bug #12068: raise overwrites exception cause even if exception is not new
https://bugs.ruby-lang.org/issues/12068#change-56979
* Author: Charles Nutter
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: 2.3.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
It appears that `raise` will overwrite the original cause of an exception even when re-raising the same one. I believe this is a bug, since loses the original cause and associates the re-raised exception with a completely unrelated cause.
Example:
```ruby
begin
begin
raise 'a'
rescue => a
begin
raise 'b'
rescue => b
p [b, b.cause]
begin
raise 'c'
rescue
raise b
end
end
end
rescue
p [$!, $!.cause]
end
```
CRuby outputs:
```
[] ~/projects/jruby $ ruby23 cause.rb
[#<RuntimeError: b>, #<RuntimeError: a>]
[#<RuntimeError: b>, #<RuntimeError: c>]
```
Here, the original cause of the "b" exception (the "a" exception) is lost, replaced during the re-raise with the "c" exception.
I believe JRuby 9.0.5.0's behavior is correct here:
```
[] ~/projects/jruby $ rvm jruby-9.0.5.0 do ruby cause.rb
[#<RuntimeError: b>, #<RuntimeError: a>]
[#<RuntimeError: b>, #<RuntimeError: a>]
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>