[pve-devel] [PATVH_V2] Bug Fix 602
Dietmar Maurer
dietmar at proxmox.com
Thu Mar 5 14:17:53 CET 2015
On 03/05/2015 02:13 PM, Dietmar Maurer wrote:
> $msg .= "$line\n";
>> };
>> - run_command($cmd, outfunc => $output, timeout => $timeout);
>> + if ($method eq "destroy") {
>> +
>> + eval {run_command($cmd, errmsg => 1, outfunc => $output, timeout
>> => $timeout);};
>> +
>> + if(my $err = $@) {
>> + return "ERROR $err";
>> + }
>
> You can do exactly the same thing with:
>
> if ($method eq "destroy") {
>
> run_command($cmd, errmsg => "ERROR ", outfunc => $output, timeout
> => $timeout);
>
> }
>
> I.e. there is no need for that additional 'eval'. Please test.
Sure, you would need to catch the exceptions at the caller site.
More information about the pve-devel
mailing list