[libvirt-php][PATCH 2/2] examples: Die early if getting a screenshot fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Our index.php has a capability to fetch a screenshot for a
domain. However, if there's a libvirt error, it just prints it
out and continue executing the rest of the script even though it
is not supposed to.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 examples/index.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/index.php b/examples/index.php
index 1ba8193..363fadd 100644
--- a/examples/index.php
+++ b/examples/index.php
@@ -17,7 +17,7 @@
             $tmp = $lv->domain_get_screenshot($_GET['uuid'], 0);
 
         if (!$tmp) {
-            echo $lv->get_last_error().'<br/>';
+            die($lv->get_last_error().'<br/>');
         } else {
             Header('Content-Type: ' . $tmp['mime']);
             die($tmp['data']);
-- 
2.8.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]