Log error before croaking and show path to file in the error message
This commit is contained in:
parent
3a512f87a5
commit
327a01cb20
|
@ -62,7 +62,10 @@ sub open
|
|||
local *sfh;
|
||||
#sysopen( *sfh, $conn->{path}, O_NONBLOCK|O_RDONLY ) or croak( "Can't sysopen: $!" );
|
||||
#open( *sfh, "<".$conn->{path} ) or croak( "Can't open: $!" );
|
||||
open( *sfh, "+<", $self->{path} ) or croak( "Can't open: $!" );
|
||||
if ( ! open( *sfh, "+<", $self->{path} ) ) {
|
||||
Error( "Can't open file at $$self{path}: $!" );
|
||||
croak( "Can't open file at $$self{path}: $!" );
|
||||
}
|
||||
$self->{state} = 'open';
|
||||
$self->{handle} = *sfh;
|
||||
}
|
||||
|
@ -73,7 +76,7 @@ __END__
|
|||
|
||||
=head1 NAME
|
||||
|
||||
ZoneMinder::Database - Perl extension for blah blah blah
|
||||
ZoneMinder::Trigger::Channel::File - ZOneMinder object for a file based trigger channel
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
|
Loading…
Reference in New Issue