diff options
| author | fukachan <fukachan> | 2001-01-24 06:11:31 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-01-24 06:11:31 +0000 |
| commit | e6a9111ca4122b24ebbc7d33bc2fcf607155a9db (patch) | |
| tree | df2a4e618111f9aa39c78e644c414836bb4eceb4 /fml/lib/IO | |
| parent | c3c2868fe6a61ee3a5c7f3a6465b5ad1259869ea (diff) | |
| download | fml8-e6a9111ca4122b24ebbc7d33bc2fcf607155a9db.tar.gz fml8-e6a9111ca4122b24ebbc7d33bc2fcf607155a9db.tar.bz2 fml8-e6a9111ca4122b24ebbc7d33bc2fcf607155a9db.zip | |
canonicalize error handlings to error() error_reason() pair
Diffstat (limited to 'fml/lib/IO')
| -rw-r--r-- | fml/lib/IO/MapAdapter.pm | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/fml/lib/IO/MapAdapter.pm b/fml/lib/IO/MapAdapter.pm index 184b0e51..915b65fa 100644 --- a/fml/lib/IO/MapAdapter.pm +++ b/fml/lib/IO/MapAdapter.pm @@ -25,7 +25,7 @@ sub new if ( ref($args) eq 'CODE' ) { $me->{_type} = 'array_on_memory'; eval { &$args($me);}; - _log($me, $@) if $@; + _error_reason($me, $@) if $@; } else { if ($args =~ /file:(\S+)/ || $args =~ m@^(/\S+)@) { @@ -46,7 +46,7 @@ sub new else { my $s = "IO::MapAdapter::new: args='$args' is unknown."; print STDERR $s, "\n"; - _log($me, $s); + _error_reason($me, $s); } } @@ -54,17 +54,17 @@ sub new } -sub _log +sub _error_reason { my ($self, $mesg) = @_; - $self->{ _error } = $mesg; + $self->{ _error_reason } = $mesg; } sub error { my ($self) = @_; - return $self->{ _error }; + return $self->{ _error_reason }; } @@ -94,7 +94,7 @@ sub open return $fh; } else { - $self->_log("Error: cannot open $file $flag"); + $self->_error_reason("Error: cannot open $file $flag"); return undef; } } @@ -121,7 +121,7 @@ sub open return undef; } else { - $self->_log("Error: type=$self->{_type} is unknown type."); + $self->_error_reason("Error: type=$self->{_type} is unknown type."); } } @@ -180,11 +180,11 @@ sub _get_address $self->{'_type'} eq 'mysql' || $self->{'_type'} eq 'postgresql' ) { - $self->_log("Error: not yet implemented"); + $self->_error_reason("Error: not yet implemented"); return undef; } else { - $self->_log("Error: type=$self->{_type} is unknown type."); + $self->_error_reason("Error: type=$self->{_type} is unknown type."); } } @@ -207,11 +207,11 @@ sub getline $self->{'_type'} eq 'mysql' || $self->{'_type'} eq 'postgresql' ) { - $self->_log("Error: not yet implemented"); + $self->_error_reason("Error: not yet implemented"); return undef; } else { - $self->_log("Error: type=$self->{_type} is unknown type."); + $self->_error_reason("Error: type=$self->{_type} is unknown type."); } } @@ -231,7 +231,7 @@ sub getpos $self->{_counter}; } else { - $self->_log("Error: type=$self->{_type} is unknown type."); + $self->_error_reason("Error: type=$self->{_type} is unknown type."); } } @@ -251,7 +251,7 @@ sub setpos $self->{_counter} = $pos; } else { - $self->_log("Error: type=$self->{_type} is unknown type."); + $self->_error_reason("Error: type=$self->{_type} is unknown type."); } } @@ -271,7 +271,7 @@ sub eof $self->{_counter} > $self->{_num_members} ? 1 : 0; } else { - $self->_log("Error: type=$self->{_type} is unknown type."); + $self->_error_reason("Error: type=$self->{_type} is unknown type."); } } @@ -290,7 +290,7 @@ sub close ; } else { - $self->_log("Error: type=$self->{_type} is unknown type."); + $self->_error_reason("Error: type=$self->{_type} is unknown type."); } } |
