MooseX::Storage - added peek()
[gitmo/MooseX-Storage.git] / lib / MooseX / Storage / Engine / IO / AtomicFile.pm
index f2e1058..6c58228 100644 (file)
@@ -4,13 +4,15 @@ use Moose;
 
 use IO::AtomicFile;
 
-our $VERSION = '0.01';
+our $VERSION   = '0.02';
+our $AUTHORITY = 'cpan:STEVAN';
 
 extends 'MooseX::Storage::Engine::IO::File';
 
 sub store {
        my ($self, $data) = @_;
-       my $fh = IO::AtomicFile->new($self->file, 'w');
+       my $fh = IO::AtomicFile->new($self->file, 'w')
+           || confess "Unable to open file (" . $self->file . ") for storing : $!";
        print $fh $data;
        $fh->close() 
            || confess "Could not write atomic file (" . $self->file . ") because: $!";