def func
some code...
rescue x,y,z
do something...
I have a function where I'm trying to rescue an exception and then do something inside of rescue. I want to understand how to handle in case there is an exception again inside of the rescue block. This is a corner case and it is definitely necessary.
In case there is an exception again inside of rescue I want to be able to handle it. Any suggestions appreciated.
You can simply nest a rescue exception inside another rescue exception and you can do so using a number of different approaches depending on the situation but here are a couple:
OR