From: Marcin Haba Date: Tue, 1 May 2018 19:25:27 +0000 (+0200) Subject: baculum: Fix catching API exceptions X-Git-Tag: Release-9.2.0~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5337dde87ebca06d2d04fe82e88933d1e54e0277;p=thirdparty%2Fbacula.git baculum: Fix catching API exceptions --- diff --git a/gui/baculum/protected/API/Class/BaculumAPIServer.php b/gui/baculum/protected/API/Class/BaculumAPIServer.php index 0968608564..29c839c98c 100644 --- a/gui/baculum/protected/API/Class/BaculumAPIServer.php +++ b/gui/baculum/protected/API/Class/BaculumAPIServer.php @@ -162,7 +162,7 @@ abstract class BaculumAPIServer extends TPage { break; } } - } catch(TException $e) { + } catch(Prado\Exceptions\TException $e) { $this->getModule('logging')->log( __FUNCTION__, "Method: {$_SERVER['REQUEST_METHOD']} $e", diff --git a/gui/baculum/protected/API/Class/Database.php b/gui/baculum/protected/API/Class/Database.php index eea4cef3b0..8c7e1dbbb5 100644 --- a/gui/baculum/protected/API/Class/Database.php +++ b/gui/baculum/protected/API/Class/Database.php @@ -53,7 +53,7 @@ class Database extends APIModule { $connection->setActive(true); $tables_format = $this->getTablesFormat($connection); $is_connection = (is_numeric($tables_format) === true && $tables_format > 0); - } catch (TDbException $e) { + } catch (Prado\Exceptions\TDbException $e) { throw new BCatalogException( DatabaseError::MSG_ERROR_DB_CONNECTION_PROBLEM . ' ' . $e->getErrorMessage(), DatabaseError::ERROR_DB_CONNECTION_PROBLEM