]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Class/Errors.php
baculum: Assign Baculum copyright to Kern Sibbald
[bacula/bacula] / gui / baculum / protected / Class / Errors.php
1 <?php
2 /*
3  * Bacula(R) - The Network Backup Solution
4  * Baculum   - Bacula web interface
5  *
6  * Copyright (C) 2013-2016 Kern Sibbald
7  *
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.
11  *
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.
16  *
17  * This notice must be preserved when any source code is
18  * conveyed and/or propagated.
19  *
20  * Bacula(R) is a registered trademark of Kern Sibbald.
21  */
22  
23 class GenericError {
24         const ERROR_NO_ERRORS = 0;
25         const ERROR_INVALID_COMMAND = 1;
26         const ERROR_INTERNAL_ERROR = 100;
27
28         const MSG_ERROR_NO_ERRORS = '';
29         const MSG_ERROR_INVALID_COMMAND = 'Invalid command.';
30         const MSG_ERROR_INTERNAL_ERROR = 'Internal error.';
31 }
32
33 class DatabaseError extends GenericError {
34         const ERROR_DB_CONNECTION_PROBLEM = 2;
35         const ERROR_WRITE_TO_DB_PROBLEM = 3;
36         
37         const MSG_ERROR_DB_CONNECTION_PROBLEM = 'Problem with connection to database.';
38         const MSG_ERROR_WRITE_TO_DB_PROBLEM = 'Error during write to database.';
39 }
40
41 class BconsoleError extends GenericError {
42
43         const ERROR_BCONSOLE_CONNECTION_PROBLEM = 4;
44         const ERROR_INVALID_DIRECTOR = 5;
45
46         const MSG_ERROR_BCONSOLE_CONNECTION_PROBLEM = 'Problem with connection to bconsole.';
47         const MSG_ERROR_INVALID_DIRECTOR = 'Invalid director.';
48 }
49
50 class AuthorizationError extends GenericError {
51
52         const ERROR_AUTHORIZATION_TO_WEBGUI_PROBLEM = 6;
53
54         const MSG_ERROR_AUTHORIZATION_TO_WEBGUI_PROBLEM = 'Problem with authorization to Baculum WebGUI.';
55 }
56
57 class ClientError extends GenericError {
58         const ERROR_CLIENT_DOES_NOT_EXISTS = 10;
59
60         const MSG_ERROR_CLIENT_DOES_NOT_EXISTS = 'Client with inputed clientid does not exist.';
61 }
62
63 class StorageError extends GenericError {
64         const ERROR_STORAGE_DOES_NOT_EXISTS = 20;
65
66         const MSG_ERROR_STORAGE_DOES_NOT_EXISTS = 'Storage with inputed storageid does not exist.';
67 }
68
69 class VolumeError extends GenericError {
70         const ERROR_VOLUME_DOES_NOT_EXISTS = 30;
71
72         const MSG_ERROR_VOLUME_DOES_NOT_EXISTS = 'Volume with inputed mediaid does not exist.';
73 }
74
75 class PoolError extends GenericError {
76         const ERROR_POOL_DOES_NOT_EXISTS = 40;
77         const ERROR_NO_VOLUMES_IN_POOL_TO_UPDATE = 41;
78
79         const MSG_ERROR_POOL_DOES_NOT_EXISTS = 'Pool with inputed poolid does not exist.';
80         const MSG_ERROR_NO_VOLUMES_IN_POOL_TO_UPDATE= 'Pool with inputed poolid does not contain any volume to update.';
81 }
82
83 class JobError extends GenericError {
84         const ERROR_JOB_DOES_NOT_EXISTS = 50;
85         const ERROR_INVALID_JOBLEVEL = 51;
86         const ERROR_FILESETID_DOES_NOT_EXISTS = 52;
87         const ERROR_CLIENTID_DOES_NOT_EXISTS = 53;
88         const ERROR_STORAGEID_DOES_NOT_EXISTS = 54;
89         const ERROR_POOLID_DOES_NOT_EXISTS = 55;
90         const ERROR_INVALID_RPATH = 56;
91         const ERROR_INVALID_WHERE_OPTION = 57;
92         const ERROR_INVALID_REPLACE_OPTION = 58;
93
94         const MSG_ERROR_JOB_DOES_NOT_EXISTS = 'Job with inputed jobid does not exist.';
95         const MSG_ERROR_INVALID_JOBLEVEL = 'Inputed job level is invalid.';
96         const MSG_ERROR_FILESETID_DOES_NOT_EXISTS = 'FileSet resource with inputed filesetid does not exist.';
97         const MSG_ERROR_CLIENTID_DOES_NOT_EXISTS = 'Client with inputed clientid does not exist.';
98         const MSG_ERROR_STORAGEID_DOES_NOT_EXISTS = 'Storage with inputed storageid does not exist.';
99         const MSG_ERROR_POOLID_DOES_NOT_EXISTS = 'Pool with inputed poolid does not exist.';
100         const MSG_ERROR_INVALID_RPATH = 'Inputed rpath for restore is invalid. Proper format is b2[0-9]+.';
101         const MSG_ERROR_INVALID_WHERE_OPTION = 'Inputed "where" option is invalid.';
102         const MSG_ERROR_INVALID_REPLACE_OPTION = 'Inputed "replace" option is invalid.';
103 }
104
105 class FileSetError extends GenericError {
106         const ERROR_FILESET_DOES_NOT_EXISTS = 60;
107
108         const MSG_ERROR_FILESET_DOES_NOT_EXISTS = 'FileSet with inputed filesetid does not exist.';
109 }
110
111 class BVFSError extends GenericError {
112         const ERROR_JOB_DOES_NOT_EXISTS = 70;
113         const ERROR_INVALID_RPATH = 71;
114         const ERROR_INVALID_RESTORE_PATH = 72;
115
116         const MSG_ERROR_JOB_DOES_NOT_EXISTS = 'Job with inputed jobid does not exist.';
117         const MSG_ERROR_INVALID_RPATH = 'Inputed path for restore is invalid. Proper format is b2[0-9]+.';
118         const MSG_ERROR_INVALID_RESTORE_PATH = 'Inputted BVFS path param is invalid.';
119 }
120 ?>