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

:no_extra_logdie_message should respect $EXCEPTIONS_BEING_CAUGHT #127

Open
Sadrak opened this issue Aug 31, 2023 · 0 comments
Open

:no_extra_logdie_message should respect $EXCEPTIONS_BEING_CAUGHT #127

Sadrak opened this issue Aug 31, 2023 · 0 comments

Comments

@Sadrak
Copy link

Sadrak commented Aug 31, 2023

We are playing with try-catch and logdie() and hit some problems.

use Log::Log4perl qw(:no_extra_logdie_message);

is bad implemented, due to the use of exit() you can't fetch the error anymore. So activating this flag will lead in a total change in behavior (not only suppress some logging).

Playing with $EXCEPTIONS_BEING_CAUGHT or $^S it is possible to throw the exception via die().

Something like that:

if (not $Log::Log4perl::LOGDIE_MESSAGE_ON_STDERR and $^S) {
    $self->and_die(@_); # or confess/croak
}

in the beginning of error_die(), logdie(), logconfess() and logcroak() solve this for us. But i am unsure where exactly this should be placed.

Or should this solved somewhere else?

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