[ruby-core:124785] [Ruby Feature#21822] Expose Return Value in the ensure Block
Issue #21822 has been updated by matz (Yukihiro Matsumoto). I don't think it's not worth for the new syntax, where you can do similar thing with: ``` begin ret = begin # .... end ensure LOGGER.debug "return value: #{ret}" end ``` Matz. ---------------------------------------- Feature #21822: Expose Return Value in the ensure Block https://bugs.ruby-lang.org/issues/21822#change-116396 * Author: artemb (Artem Borodkin) * Status: Open ---------------------------------------- I'd like to propose a simple feature that allows easy access to the return value inside an ensure block. ```ruby begin # ... ensure => ret # ret is nil if an exception is raised LOGGER.debug "return value: #{ret}" end ``` -- https://bugs.ruby-lang.org/
participants (1)
-
matz (Yukihiro Matsumoto)