From: Thomas Lamprecht Date: Wed, 29 Apr 2020 12:51:59 +0000 (+0200) Subject: section config: use croak so that the error is from the callers POV X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=7db4e5d763d734bbe45dc1773543b028298068f9;ds=sidebyside section config: use croak so that the error is from the callers POV Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index cf87d6f..b46b59e 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -3,6 +3,7 @@ package PVE::SectionConfig; use strict; use warnings; +use Carp; use Digest::SHA; use PVE::Exception qw(raise_param_exc); @@ -198,6 +199,8 @@ sub init { sub lookup { my ($class, $type) = @_; + croak "cannot lookup undefined type!" if !defined($type); + my $pdata = $class->private(); my $plugin = $pdata->{plugins}->{$type};