api/create: print correct error message if cleanup fails

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-01-26 14:39:38 +01:00
parent fc5c194b5d
commit f1e277cd88

View File

@ -648,8 +648,7 @@ __PACKAGE__->register_method({
if (my $err = $@) {
eval {
my $conffile = PVE::QemuConfig->config_file($vmid);
unlink($conffile)
or die "failed to remove config file: $@\n";
unlink($conffile) or die "failed to remove config file: $!\n";
};
warn $@ if $@;
die $err;