summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-12-15 14:05:52 +0000
committerfukachan <fukachan>2002-12-15 14:05:52 +0000
commite35cce146f41981ce5d40ea65e3fb4352582a3a7 (patch)
treed9a8d9c4d6e33b301e38d6746bcc5381b977fa16 /fml
parentfb0afcda9019cf1e63b837685adc0d3cb4cfc297 (diff)
downloadfml8-e35cce146f41981ce5d40ea65e3fb4352582a3a7.tar.gz
fml8-e35cce146f41981ce5d40ea65e3fb4352582a3a7.tar.bz2
fml8-e35cce146f41981ce5d40ea65e3fb4352582a3a7.zip
clean up comments.
defined() check. forward method: errstr() -> error().
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/ErrorStatus.pm22
1 files changed, 13 insertions, 9 deletions
diff --git a/fml/lib/ErrorStatus.pm b/fml/lib/ErrorStatus.pm
index 5f80d394..80ff1c2b 100644
--- a/fml/lib/ErrorStatus.pm
+++ b/fml/lib/ErrorStatus.pm
@@ -4,11 +4,15 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: ErrorStatus.pm,v 1.4 2002/09/11 23:18:00 fukachan Exp $
+# $FML: ErrorStatus.pm,v 1.5 2002/09/22 14:56:37 fukachan Exp $
#
package ErrorStatus;
+#
+# XXX-TODO we should not use ErrorStatus module, is'nt it?
+#
+
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK);
use Carp;
@@ -58,43 +62,43 @@ return $message which is saved by C<error_set($msg)>.
=cut
-# Descriptions: set the error message
+# Descriptions: save the error message in $self object.
# Arguments: OBJ($self) STR($mesg)
# Side Effects: update OBJ
# Return Value: STR
sub error_set
{
my ($self, $mesg) = @_;
- $self->{'_error_reason'} = $mesg;
+ $self->{'_error_reason'} = $mesg if defined $mesg;
}
-# Descriptions: get the error message
+# Descriptions: get the error message.
# Arguments: OBJ($self)
# Side Effects: none
# Return Value: STR
sub error
{
my ($self) = @_;
- return $self->{'_error_reason'};
+ return $self->{'_error_reason'} ? $self->{'_error_reason'} : undef;
}
-# Descriptions: get the error message
+# Descriptions: get the error message.
# Arguments: OBJ($self)
# Side Effects: none
# Return Value: STR
sub errstr
{
my ($self) = @_;
- return $self->{'_error_reason'};
+ return $self->error();
}
-# Descriptions: clear the error message
+# Descriptions: clear the error message buffer.
# Arguments: OBJ($self)
# Side Effects: none
-# Return Value: STR
+# Return Value: STR (cleared message)
sub error_clear
{
my ($self) = @_;