]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Tools.pm
run with timeout: only special-case timeout error in list-context
[pve-common.git] / src / PVE / Tools.pm
index 50240c8fc34df12a1ea9bb0bac1093bd54721b03..724fb696b2c7c78a7dd4168ca9914a4bf2573683 100644 (file)
@@ -143,7 +143,8 @@ sub run_with_timeout {
     # this shouldn't happen anymore?
     die "unknown error" if $sigcount && !$err; # seems to happen sometimes
 
-    die $err if $err && !wantarray; # assume that user handles timeout err if called in list context
+    # assume that user handles timeout err if called in list context
+    die $err if $err && (!wantarray || !$got_timeout);
 
     return wantarray ? ($res, $got_timeout) : $res;
 }