Revision ff296f5f
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/Common.pm | ||
---|---|---|
9 | 9 |
package Common; |
10 | 10 |
|
11 | 11 |
use Time::HiRes qw(gettimeofday); |
12 |
use Data::Dumper; |
|
12 | 13 |
|
13 | 14 |
use SL::DBUtils; |
14 | 15 |
|
... | ... | |
516 | 517 |
foreach my $key (@_) { |
517 | 518 |
if ((ref $key eq '') && !defined $params->{$key}) { |
518 | 519 |
my $subroutine = (caller(1))[3]; |
520 |
$main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, "[Common::check_params] failed, params object dumped below"); |
|
521 |
$main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, Dumper($params)); |
|
519 | 522 |
$main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine)); |
520 | 523 |
|
521 | 524 |
} elsif (ref $key eq 'ARRAY') { |
... | ... | |
529 | 532 |
|
530 | 533 |
if (!$found) { |
531 | 534 |
my $subroutine = (caller(1))[3]; |
535 |
$main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, "[Common::check_params] failed, params object dumped below"); |
|
536 |
$main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, Dumper($params)); |
|
532 | 537 |
$main::form->error($main::locale->text("Missing parameter (at least one of #1) in call to sub #2.", join(', ', @{ $key }), $subroutine)); |
533 | 538 |
} |
534 | 539 |
} |
Auch abrufbar als: Unified diff
Debugging: Common::check_params gibt jetzt bei Fehler einen Dump des $param Parameters aus.
Getriggert wird der Dump durch das Debugflag BACKTRACE ON ERROR.