3 * Bacula(R) - The Network Backup Solution
4 * Baculum - Bacula web interface
6 * Copyright (C) 2013-2017 Kern Sibbald
8 * The main author of Baculum is Marcin Haba.
9 * The original author of Bacula is Kern Sibbald, with contributions
10 * from many others, a complete list can be found in the file AUTHORS.
12 * You may use this file and others of this release according to the
13 * license defined in the LICENSE file, which includes the Affero General
14 * Public License, v3.0 ("AGPLv3") and some additional permissions and
15 * terms pursuant to its AGPLv3 Section 7.
17 * This notice must be preserved when any source code is
18 * conveyed and/or propagated.
20 * Bacula(R) is a registered trademark of Kern Sibbald.
23 Prado::using('System.Exceptions.TException');
25 class BException extends TException {
28 private $error_message;
30 public function __construct($error_message, $error_code) {
31 $this->setErrorMessage($error_message);
32 $this->setErrorCode($error_code);
33 parent::__construct($error_message);
36 public function getErrorCode() {
37 return $this->error_code;
40 public function setErrorCode($error_code) {
41 $this->error_code = $error_code;
44 public function getErrorMessage() {
45 return $this->error_message;
48 public function setErrorMessage($error_message) {
49 $this->error_message = $error_message;
52 public function __toString() {
53 $msg = sprintf('Error: %d, Message: %s', $this->getErrorCode(), $this->getErrorMessage());
58 class BCatalogException extends BException {
61 class BConsoleException extends BException {
64 class BConfigException extends BException {