Bug 17502: Add info when throwing the exception
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 19 Apr 2017 18:34:17 +0000 (15:34 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 21 Apr 2017 11:36:25 +0000 (07:36 -0400)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/DateUtils.pm

index 66ad264..af5ce7e 100644 (file)
@@ -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/ ) {