Feature #11337
closed
Allow rescue without begin inside blocks
Added by rosenfeld (Rodrigo Rosenfeld Rosas) over 9 years ago.
Updated over 8 years ago.
Description
While it's possible to have rescue's without begin in method definitions it's not possible to have the same facility inside blocks. For example, this is currently not possible:
1.times do
abc
rescue
p 'error'
end
But this is possible
def a
abc
rescue
p 'error'
end
Would it be possible to also allow rescue without begin inside blocks too?
Could you please close this one? It seems it's a duplicate of issue #7882.
issue #12623 seems to be yet another recent request for the same feature and should probably be closed as a duplicate of #7882 as well.
- Is duplicate of Feature #7882: Allow rescue/else/ensure in do..end added
Issues linked. I guess those duplicated issues synchronizes their status each other so I don't close them (am I correct?).
On 2016/08/02 10:54, shyouhei@ruby-lang.org wrote:
I guess those duplicated issues synchronizes their status each other so I don't close them (am I correct?).
I guess it depends on how you linked them. If it's just 'related', then
the status of each is independent. If it's 'depends on', then you can
close one without closing the other, but not the other way round. But
I'm not sure this is enforced.
http://www.redmine.org/projects/redmine/wiki/RedmineIssues
"duplicates - Links issues so that closing one, will close the other (e.g. closing A will close B)
For example, if issue B duplicates A:
- closing B will leave A open
- closing A will automatically close B
duplicated by - Reciprocal of duplicates.
For example, if issue A is duplicated by issue B:
- closing B will leave A open
- closing A will automatically close B"
I'm not sure I completely understand this but it seems to be possible to close the duplicates without closing the original even though they would be automatically closed if using the right relation :)
If I understood it correctly, this issues currently duplicates #7882 which means closing this one would keep the other open.
- Status changed from Open to Closed
Hmm.. Thank you for the check. It is complicated than I thought. Closing this one anyway.
On 2016/08/04 04:23, rr.rosas@gmail.com wrote:
http://www.redmine.org/projects/redmine/wiki/RedmineIssues
I'm not sure I completely understand this but it seems to be possible to close the duplicates without closing the original even though they would be automatically closed if using the right relation :)
Well, I guess closing the duplicate is done because it's recognized as a
duplicate and no longer needed. Closing the original means that the
problem itself is solved, so it would be wrong to keep the duplicates open.
Regards, Martin.
- Has duplicate Feature #12906: do/end blocks work with ensure/rescue/else added
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0