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

WrapScope: wrapped methods' exceptions aren't properly propagated #2

Open
marrem opened this issue May 8, 2024 · 1 comment
Open

Comments

@marrem
Copy link

marrem commented May 8, 2024

Simple wrapped method:

package CAIW::t::MyModule;
...
use OpenTracing::WrapScope qw(
	doSomething
);

sub doSomething {

	say "Processing";
	die "Ooops, something went wrong";
}
1;

Output:

$ perl openTracingWrapScopeExceptionHandling.pl 
Processing
Died at /usr/local/share/perl/5.36.0/OpenTracing/WrapScope.pm line 163.

Expected output:

$ PERL_OPENTRACING_DEBUG= perl openTracingWrapScopeExceptionHandling.pl 
Processing
Ooops, something went wrong at /usr/local/imta/lib/perl/CAIW/t/MyModule.pm line 13.

Same behaviour is observed when dying with an 'exception' object, instead of the expected object (when capturing $@) there is just the string "Died at /usr/local/share/perl/5.36.0/OpenTracing/WrapScope.pm line 163."

@marrem
Copy link
Author

marrem commented May 8, 2024

I proposed a PR to fix this issue: https://pull/3

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

No branches or pull requests

1 participant