Added option for a fatal error.

This commit is contained in:
Elijah Perrault committed 2011-01-16 23:44:20 -07:00
1 parent 9c951f0d21
commit 95419d212d
1 file changed
+9 -1
+9 -1
View File
@@ -90,12 +90,15 @@ sub trans
# Error subroutine.
sub err
{
my ($lvl, $msg) = @_;
my ($lvl, $msg, $fatal) = @_;
# Check for an invalid level.
if ($lvl =~ m/[^0-9]/) {
return 0;
}
if ($fatal =~ m/(^0|1)/) {
return 0;
}
# Level 1: Print to screen.
if ($lvl => 1) {
@@ -105,6 +108,11 @@ sub err
if ($lvl => 2) {
API::Log::alog("ERROR: $msg");
}
# If it's a fatal error, exit the program.
if ($fatal) {
exit;
}
}
1;