Permalink
Browse files

Use carp to get useful errors

  • Loading branch information...
zerodogg committed May 8, 2012
1 parent cbc94af commit 67dcbfcbca587f77e0d264b4ed713e10c720ed7d
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/LIXUZ/HelperModules/Files.pm
@@ -56,6 +56,7 @@ use Exporter qw(import);
use File::stat;
use IO::File ();
use LIXUZ::HelperModules::Cache qw(get_ckey CT_24H);
+use Carp qw(croak);
our @EXPORT_OK = qw(lixuz_serve_static_file lixuz_serve_scalar_file get_new_aspect fsize);
@@ -146,12 +147,12 @@ sub get_new_aspect
}
if ((not defined $oldVal or $oldVal == 0) || (not defined $newVal or $newVal == 0))
{
- die("oldVal or newVal is zero");
+ croak("oldVal or newVal is zero");
}
$percentage_change = $oldVal/$newVal;
if ($changeVal == 0 || $percentage_change == 0)
{
- die("changeVal or percentage_change is zero");
+ croak("changeVal or percentage_change is zero");
}
return sprintf('%d',$changeVal / $percentage_change );
}

0 comments on commit 67dcbfc

Please sign in to comment.