From ff296f5fbc1a4c2d681be64b9696671e00b6aa78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 30 Sep 2009 12:39:09 +0200 Subject: [PATCH] Debugging: Common::check_params gibt jetzt bei Fehler einen Dump des $param Parameters aus. Getriggert wird der Dump durch das Debugflag BACKTRACE ON ERROR. --- SL/Common.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SL/Common.pm b/SL/Common.pm index bdc4c5dd6..8207032db 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -9,6 +9,7 @@ package Common; use Time::HiRes qw(gettimeofday); +use Data::Dumper; use SL::DBUtils; @@ -516,6 +517,8 @@ sub check_params { foreach my $key (@_) { if ((ref $key eq '') && !defined $params->{$key}) { my $subroutine = (caller(1))[3]; + $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, "[Common::check_params] failed, params object dumped below"); + $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, Dumper($params)); $main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine)); } elsif (ref $key eq 'ARRAY') { @@ -529,6 +532,8 @@ sub check_params { if (!$found) { my $subroutine = (caller(1))[3]; + $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, "[Common::check_params] failed, params object dumped below"); + $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, Dumper($params)); $main::form->error($main::locale->text("Missing parameter (at least one of #1) in call to sub #2.", join(', ', @{ $key }), $subroutine)); } } -- 2.20.1