On Thursday, August 25, 2016 at 5:47:14 PM UTC-7, John Backus wrote: > > When I'm rescuing a database exception that `Sequel` is reraising I can > either access the original exception using Sequel::Error#wrapped_exception > or Exception#cause. My app is on Ruby 2.3 so I don't have to worry about > Exception#cause not being supported. Is there any benefit from using > #wrapped_exception instead of #cause? >
#wrapped_exception predates #cause by quite a bit. However, if your ruby supports #cause, there's no reason to use #wrapped_exception. I think the only time they could differ is when exception handling is nested and the first exception is returned instead of the second. I think there are cases like that in Sequel, but they are fairly rare. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
