From 34e250c7144adfaa0ef184a454434dca31fd01f2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 19 Apr 2017 15:34:17 -0300 Subject: [PATCH] Bug 17502: Add info when throwing the exception Signed-off-by: Jonathan Druart --- Koha/DateUtils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 66ad264..af5ce7e 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -218,7 +218,7 @@ sub output_pref { } return if !defined $dt; # NULL date - Koha::Exceptions::WrongParameter->throw( 'dt is not a datetime' ) if ref($dt) ne 'DateTime'; + Koha::Exceptions::WrongParameter->throw( "output_pref is called with '$dt' (ref ". ( ref($dt) ? ref($dt):'SCALAR')."), not a DateTime object") if ref($dt) ne 'DateTime'; # FIXME: see bug 13242 => no TZ for dates 'infinite' if ( $dt->ymd !~ /^9999/ ) { -- 2.9.3