mirror of https://github.com/jimsalterjrs/sanoid
feat: crash if template can't be found
Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com>
This commit is contained in:
parent
dbcaeef1ac
commit
f5ac493bbd
6
sanoid
6
sanoid
|
|
@ -1020,6 +1020,12 @@ sub init {
|
|||
$rawtemplate =~ s/\s+$//g;
|
||||
|
||||
my $template = 'template_'.$rawtemplate;
|
||||
|
||||
# Check if template exists
|
||||
if (!exists $ini{$template}) {
|
||||
die "FATAL ERROR: Template '$rawtemplate' referenced in section [$section] does not exist in $conf_file.\n";
|
||||
}
|
||||
|
||||
foreach my $key (keys %{$ini{$template}}) {
|
||||
if ($key =~ /template|recursive/) {
|
||||
warn "ignored key '$key' from '$rawtemplate' template.\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue