]> git.proxmox.com Git - pve-client.git/commitdiff
Handle errors on tasks correctly with a die,
authorRené Jochum <r.jochum@proxmox.com>
Wed, 20 Jun 2018 09:46:55 +0000 (11:46 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 20 Jun 2018 10:29:23 +0000 (12:29 +0200)
so we get the correct exit code on errors.

Signed-off-by: René Jochum <r.jochum@proxmox.com>
PVE/APIClient/Helpers.pm

index 7d855ec6ce58fc6775569fbb426c364dcc3f58bf..5c2e4cb661353b2284497cf0023b754a4f52963d 100644 (file)
@@ -355,6 +355,10 @@ sub poll_task {
        sleep(2);
     }
 
        sleep(2);
     }
 
+    if ($task_status->{exitstatus} ne "OK") {
+       die $task_status->{exitstatus};
+    }
+
     return $task_status->{exitstatus};
 }
 
     return $task_status->{exitstatus};
 }