From: René Jochum Date: Wed, 20 Jun 2018 09:46:55 +0000 (+0200) Subject: Handle errors on tasks correctly with a die, X-Git-Url: https://git.proxmox.com/?p=pve-client.git;a=commitdiff_plain;h=20e7131b2dda5e951aa612a37e3ca2d84645ff42 Handle errors on tasks correctly with a die, so we get the correct exit code on errors. Signed-off-by: René Jochum --- diff --git a/PVE/APIClient/Helpers.pm b/PVE/APIClient/Helpers.pm index 7d855ec..5c2e4cb 100644 --- a/PVE/APIClient/Helpers.pm +++ b/PVE/APIClient/Helpers.pm @@ -355,6 +355,10 @@ sub poll_task { sleep(2); } + if ($task_status->{exitstatus} ne "OK") { + die $task_status->{exitstatus}; + } + return $task_status->{exitstatus}; }