]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fix saving logs when an error occurs
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 12 Aug 2018 09:48:24 +0000 (11:48 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 12 Aug 2018 15:14:23 +0000 (17:14 +0200)
gui/baculum/protected/Web/Class/BaculumAPIClient.php

index 2823cb9d3f198716efdc6ff0c6d4878ce3332612..ab11e4592f5dee90d65ef72dc0b8519188318344 100644 (file)
@@ -467,6 +467,8 @@ class BaculumAPIClient extends WebModule {
                if ($show_error === true && $resource->error != 0) {
                        $url = $this->Service->constructUrl('BaculumError', (array)$resource, false);
                        header("Location: $url");
+                       // write all logs before exiting, otherwise they will be lost
+                       $this->getModule('log')->collectLogs(null);
                        exit();
                }