# # sebastien.letort@toulouse.inra.fr # Created: september 18, 2007 # Last Updated: september 18, 2007 # package LipmError;
LipmError - a class to interface Error classe developped in the lipm
It's an interface, it should not be instancied
This interface centralized what is common with all Error class developped in the lipm. It declare our global error code and some common methods.
GetMsg IsFatal Explain
Sebastien Letort : sebastien.letort@toulouse.inra.fr
use warnings; use strict; ## this class inherit from Error.pm use base qw(Error); # constantes use constant FATAL => 0001; BEGIN { our $VERSION = do {my @r = (q$Rev: 172 $ =~ /\d+/g); $r[0]}; }
Title : IsFatal Usage : my $bool = $err->IsFatal() Prerequiste: Fatal code are odd code value Function : tell if the program must stop Returns : a boolean, 1 if value is FATAL Args : none Error : none Globals : none
sub IsFatal { my $self = shift; return ($self->{-value} & &FATAL); }
Title : GetMsg Usage : my $msg = $err->GetMsg() Prerequiste: none Function : give a formatted msg containing where the error occurred Returns : a string Args : none Error : none Globals : none
sub GetMsg { my $self = shift; # Construct message my $msg = ref($self) . " thrown by " . $self->{-file}; $msg .= " on line " . $self->{-line} . "\n"; return $msg; }
Title : Explain Usage : my $string = $err->Explain() Prerequiste: pure virtual method, it have to be overwritten to be used Function : explain the error in details Returns : a string Args : none Error : none Globals : none
sub Explain { } 1;