mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-02 01:21:14 +00:00
Read a given config file
Throw an exception if it cannot be read
This commit is contained in:
parent
3caf243048
commit
3fedc40eaf
4 changed files with 39 additions and 12 deletions
|
@ -110,7 +110,15 @@ sub parse_config_file {
|
|||
|
||||
$self->debug( 2, 'Loading in config file: ', $config_file );
|
||||
|
||||
return if ( !-e $config_file || !-r $config_file );
|
||||
if ( !-e $config_file || !-r $config_file ){
|
||||
croak(
|
||||
App::ClusterSSH::Exception::Config->throw(
|
||||
error => $self->loc(
|
||||
'File [_1] does not exist or cannot be read', $config_file
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
open( CFG, $config_file ) or die("Couldnt open $config_file: $!");
|
||||
my $l;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue