Comment by JamesSwift
Comment by JamesSwift a day ago
I thought ruby would auto-wrap the original exception as long as you are raising from a rescue block (i.e. as long as $! is non-nil). So in that case you can just
raise "Failed to execute memoized method '#{method_name}'"
And ruby will set `cause` for youhttps://pablofernandez.tech/2014/02/05/wrapped-exceptions-in...
TIL! That's pretty cool. I still think if you have no reason to catch an error (i.e. state tracking, etc.) then you should not.