| Server IP : 82.208.35.60 / Your IP : 216.73.217.116 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/devel/p5-Config-Objective/files/ |
Upload File : |
--- ./lib/Config/Objective.pm.sav Wed Apr 6 19:24:00 2005
+++ ./lib/Config/Objective.pm Wed Apr 6 19:31:48 2005
@@ -91,17 +91,21 @@
$method = 'default'
if (!defined($method));
- $retval = eval { $self->{'objs'}->{$obj}->$method(@args); };
- if ($@)
+ #
+ # Trap and extend die and warn so we can tell the user where
+ # we were when the signals were generated.
+ #
+ if (@{$self->{'lexer_stack'}})
{
- if (@{$self->{'lexer_stack'}})
- {
- $line = $self->{'lexer_stack'}->[-1]->line;
- $msg = "$self->{'file_stack'}->[-1]:$line: ";
- }
- $msg .= "$obj";
- die "$msg: $@";
+ $line = $self->{'lexer_stack'}->[-1]->line;
+ $msg = "$self->{'file_stack'}->[-1]: line $line: ";
}
+ $msg .= $obj;
+
+ local $SIG{__DIE__} = sub { die "$msg: $_[0]"; };
+ local $SIG{__WARN__} = sub { warn "$msg: $_[0]"; };
+
+ $retval = $self->{'objs'}->{$obj}->$method(@args);
# print "<== _call_obj_method(): returning '"
# . (defined($retval) ? $retval : 'undef') . "'\n";