Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use optional module Scope::Cleanup for trapping exceptions from the finally block #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pali
Copy link

@pali pali commented Jan 14, 2018

Currently throwing exception from the finally block show just:

Execution of finally() block $code resulted in an exception, which
CAN NOT BE PROPAGATED due to fundamental limitations of Perl.

This patch implements throwing exceptions form the finally block via
optional module Scope::Cleanup. When module is not installed then Try::Tiny
would show same message as before. When installed, then it cleanup will
rethrow exception from finally block back to the caller.

There is also a new test which check that finally blocks are always called
in same order as before this patch.

…inally block

Currently throwing exception from the finally block show just:

Execution of finally() block $code resulted in an exception, which
*CAN NOT BE PROPAGATED* due to fundamental limitations of Perl.

This patch implements throwing exceptions form the finally block via
optional module Scope::Cleanup. When module is not installed then Try::Tiny
would show same message as before. When installed, then it cleanup will
rethrow exception from finally block back to the caller.

There is also a new test which check that finally blocks are always called
in same order as before this patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant