Subject: | sub flush returns true even on failure (very much not good) |
sub flush returns true even on failure (very much not good)
I was playing with driver:File
and doing
$session->flush() or die $session->error();
when the driver couldn't save RESULTED IN NO ERRORS!!!!!!!!!!
I CANNOT BELIEVE MY EYES!!!!!!!!!!
I CANNOT CONCIEVE OF NOBODY RUNNING INTO THIS BEFORE VERSION 3.93
THIS IS SO CRITICAL IT'S INSANE
Kindly fix it immediately, please.
sub flush {
my $self = shift;
my $status = $self->{_STATUS};
if ( $status == MODIFIED ) {
return undef
unless
$self->store($self->id, $self->{_OPTIONS}, $self->{_DATA});
$self->{_STATUS} = SYNCED;
return 1;
}elsif ( $status == DELETED ) {
return $self->remove($self->id, $self->{_OPTIONS});
}
}
btw, this is how DESTROY should look
sub DESTROY {
my $self = shift;
$self->flush() or die "EEEEEK! COULD NOT FLUSH() ",$self->error();
$self->can('teardown') && $self->teardown();
}