From ea2196c6527c643873fb3161d3e07d23e0202f1d 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 Signed-off-by: Kyle M Hall --- Koha/DateUtils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 66ad2642fe..af5ce7ebbd 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.39.5