You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Java, Python and Javascript, if you do not specify a catch block, the exception is thrown (after executing a final block).
In contrast, when the catch block is ommitted, Try::Tiny will simply behave as if you specified an empty catch block, and will suppress the exception.
I'm not asking for this behaviour to change. I'm just asking that this behaviour be better documented, as I read the documentation and yet this behaviour still surprised me. For example, including a paragraph like this would be very helpful to people like me:
Try::Tiny's try/catch/finally construct behaves very similarly to equivalent constructs in other programming languages, such as Java, Javascript and Python. One difference may surprise you, however: Try::Tiny will treat an unspecified catch block as an empty catch block, suppressing the exception, unlike other languages which will rethrow the exception. You have been warned!
The text was updated successfully, but these errors were encountered:
Can you submit a pull request for this? One thing that would be worth noting is that while it is different from the behavior in languages like Java, it does follow the same behavior as eval in Perl.
In Java, Python and Javascript, if you do not specify a catch block, the exception is thrown (after executing a final block).
In contrast, when the catch block is ommitted, Try::Tiny will simply behave as if you specified an empty catch block, and will suppress the exception.
I'm not asking for this behaviour to change. I'm just asking that this behaviour be better documented, as I read the documentation and yet this behaviour still surprised me. For example, including a paragraph like this would be very helpful to people like me:
The text was updated successfully, but these errors were encountered: