Handle errors on tasks correctly with a die,
[pve-client.git] / PVE / APIClient / Helpers.pm
index 7d855ec..5c2e4cb 100644 (file)
@@ -355,6 +355,10 @@ sub poll_task {
        sleep(2);
     }
 
+    if ($task_status->{exitstatus} ne "OK") {
+       die $task_status->{exitstatus};
+    }
+
     return $task_status->{exitstatus};
 }