croak more, carp less (die on anything which is unrecoverable)
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 6 Jan 2005 00:40:07 +0000 (00:40 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 6 Jan 2005 00:40:07 +0000 (00:40 +0000)
git-svn-id: file:///home/dpavlin/svn/Biblio-Isis/trunk@34 4670fa4d-42ec-0310-ab5b-a66af6943492

IsisDB.pm

index 5a25d5b..be47f6d 100644 (file)
--- a/IsisDB.pm
+++ b/IsisDB.pm
@@ -192,12 +192,12 @@ sub new {
        # NXTMFB*       last block allocated to master file
        # NXTMFP        offset to next available position in last block
        # MFTYPE        always 0 for user db file (1 for system)
-       seek($self->{'fileMST'},4,0) || carp "can't seek to offset 0 in MST: $!";
+       seek($self->{'fileMST'},4,0) || croak "can't seek to offset 0 in MST: $!";
 
        my $buff;
 
-       read($self->{'fileMST'}, $buff, 4) || carp "can't read NXTMFN from MST: $!";
-       $self->{'NXTMFN'}=unpack("V",$buff) || carp "NXTNFN is zero";
+       read($self->{'fileMST'}, $buff, 4) || croak "can't read NXTMFN from MST: $!";
+       $self->{'NXTMFN'}=unpack("V",$buff) || croak "NXTNFN is zero";
 
        print STDERR Dumper($self),"\n" if ($self->{debug});
 
@@ -240,15 +240,15 @@ sub read_cnt  {
 
        # Get the index information from $db.CNT
    
-       open(my $fileCNT, $self->{cnt_file}) || carp "can't read '$self->{cnt_file}': $!";
+       open(my $fileCNT, $self->{cnt_file}) || croak "can't read '$self->{cnt_file}': $!";
        binmode($fileCNT);
 
        my $buff;
 
-       read($fileCNT, $buff, 26) || carp "can't read first table from CNT: $!";
+       read($fileCNT, $buff, 26) || croak "can't read first table from CNT: $!";
        $self->unpack_cnt($buff);
 
-       read($fileCNT, $buff, 26) || carp "can't read second table from CNT: $!";
+       read($fileCNT, $buff, 26) || croak "can't read second table from CNT: $!";
        $self->unpack_cnt($buff);
 
        close($fileCNT);
@@ -335,7 +335,7 @@ sub fetch {
 
        # read XRFMFB abd XRFMFP
        read($self->{'fileXRF'}, $buff, 4);
-       my $pointer=unpack("V",$buff) || carp "pointer is null";
+       my $pointer=unpack("V",$buff) || croak "pointer is null";
 
        # check for logically deleted record
        if ($pointer & 0x80000000) {