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