CUBRID Engine  latest
condition_handler_err.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * condition_handler_err.h : CO error condition codes and formats
22  *
23  */
24 
25 #ifndef _CONDITION_HANDLER_ERR_H_
26 #define _CONDITION_HANDLER_ERR_H_
27 
28 #ident "$Id$"
29 
30 #include <errno.h>
31 #include "condition_handler_code.h"
32 
33 #define CO_ERR_BAD_FORMAT CO_CODE(CO_MODULE_CO, 1)
34 #define CO_ER_FMT_BAD_FORMAT \
35  "Condition signalled with unknown parameter type `%s'."
36 
37 #define CO_ERR_CATALOG_NAME_EXISTS CO_CODE(CO_MODULE_CO, 2)
38 #define CO_ER_FMT_CATALOG_NAME_EXISTS \
39  "Can't register catalog `%s' with module %d -- already registered with %d."
40 
41 #define CO_ERR_CATALOG_CODE_EXISTS CO_CODE(CO_MODULE_CO, 3)
42 #define CO_ER_FMT_CATALOG_CODE_EXISTS \
43  "Can't register module %d with catalog `%s' -- already registered with `%s'."
44 
45 #define CO_ERR_BAD_MODULE CO_CODE(CO_MODULE_CO, 4)
46 #define CO_ER_FMT_BAD_MODULE \
47  "Invalid module identifier %d -- must be non-negative and less than %d."
48 
49 #define CO_ERR_BAD_CODE CO_CODE(CO_MODULE_CO, 5)
50 #define CO_ER_FMT_BAD_CODE \
51  "Invalid condition code %d -- must be less than zero."
52 
53 #define CO_ERR_BAD_DETAIL CO_CODE(CO_MODULE_CO, 6)
54 #define CO_ER_FMT_BAD_DETAIL \
55  "Unknown detail level %d."
56 
57 #define CO_ERR_BAD_POSITION CO_CODE(CO_MODULE_CO, 7)
58 #define CO_ER_FMT_BAD_POSITION \
59  "Default message format cannot contain a position specifier."
60 
61 /* File system errors */
62 
63 #define CO_SYS_ERR_NOT_OWNER CO_CODE(CO_MODULE_SYS, EPERM)
64 #define CO_SYS_ER_FMT_NOT_OWNER \
65  "Can't access `%s' -- you are not the owner."
66 
67 #define CO_SYS_ERR_FILE_NOT_FOUND CO_CODE(CO_MODULE_SYS, ENOENT)
68 #define CO_SYS_ER_FMT_FILE_NOT_FOUND \
69  "Can't access `%s' -- the file was not found."
70 
71 #define CO_SYS_ERR_IO CO_CODE(CO_MODULE_SYS, EIO)
72 #define CO_SYS_ER_FMT_IO \
73  "Can't access `%s' -- an I/O error occurred."
74 
75 #define CO_SYS_ERR_DEVICE_NOT_FOUND CO_CODE(CO_MODULE_SYS, ENXIO)
76 #define CO_SYS_ER_FMT_DEVICE_NOT_FOUND \
77  "Can't access `%s' -- the device was not found."
78 
79 #define CO_SYS_ERR_PERMISSION_DENIED CO_CODE(CO_MODULE_SYS, EACCES)
80 #define CO_SYS_ER_FMT_PERMISSION_DENIED \
81  "Can't access `%s' -- permission was denied."
82 
83 #define CO_SYS_ERR_BLOCK_REQUIRED CO_CODE(CO_MODULE_SYS, ENOTBLK)
84 #define CO_SYS_ER_FMT_BLOCK_REQUIRED \
85  "Can't access `%s' -- a block device is required."
86 
87 #define CO_SYS_ERR_BUSY CO_CODE(CO_MODULE_SYS, EBUSY)
88 #define CO_SYS_ER_FMT_BUSY \
89  "Can't access `%s' -- the mount device is busy."
90 
91 #define CO_SYS_ERR_EXISTS CO_CODE(CO_MODULE_SYS, EEXIST)
92 #define CO_SYS_ER_FMT_EXISTS \
93  "Can't create `%s' -- the file already exists."
94 
95 #define CO_SYS_ERR_CROSS_LINK CO_CODE(CO_MODULE_SYS, EXDEV)
96 #define CO_SYS_ER_FMT_CROSS_LINK \
97  "Can't access `%s' -- it is a cross-device link."
98 
99 #define CO_SYS_ERR_NO_DEVICE CO_CODE(CO_MODULE_SYS, ENODEV)
100 #define CO_SYS_ER_FMT_NO_DEVICE CO_SYS_ER_FMT_DEVICE_NOT_FOUND
101 
102 #define CO_SYS_ERR_NOT_DIR CO_CODE(CO_MODULE_SYS, ENOTDIR)
103 #define CO_SYS_ER_FMT_NOT_DIR \
104  "Can't access `%s' -- it is not a directory."
105 
106 #define CO_SYS_ERR_IS_DIR CO_CODE(CO_MODULE_SYS, EISDIR)
107 #define CO_SYS_ER_FMT_IS_DIR \
108  "Can't access `%s' -- it is a directory."
109 
110 #define CO_SYS_ERR_NOT_TYPEWRITER CO_CODE(CO_MODULE_SYS, ENOTTY)
111 #define CO_SYS_ER_FMT_NOT_TYPEWRITER \
112  "Can't access `%s' -- it is not a typewriter."
113 
114 #define CO_SYS_ERR_TEXT_BUSY CO_CODE(CO_MODULE_SYS, ETXTBSY)
115 #define CO_SYS_ER_FMT_TEXT_BUSY \
116  "Can't access `%s' -- the file is busy."
117 
118 #define CO_SYS_ERR_FILE_TOO_BIG CO_CODE(CO_MODULE_SYS, EFBIG)
119 #define CO_SYS_ER_FMT_FILE_TOO_BIG \
120  "The file `%s' is too large."
121 
122 #define CO_SYS_ERR_INVALID_SEEK CO_CODE(CO_MODULE_SYS, ESPIPE)
123 #define CO_SYS_ER_FMT_INVALID_SEEK \
124  "Can't seek to %d -- illegal seek."
125 
126 #define CO_SYS_ERR_TOO_MANY_LINKS CO_CODE(CO_MODULE_SYS, EMLINK)
127 #define CO_SYS_ER_FMT_TOO_MANY_LINKS \
128  "Can't access `%s' -- too many links were encountered."
129 
130 #define CO_SYS_ERR_BAD_FILE_NO CO_CODE(CO_MODULE_SYS, EBADF)
131 #define CO_SYS_ER_FMT_BAD_FILE_NO \
132  "The file number %d is invalid."
133 
134 /* Process errors */
135 #define CO_SYS_ERR_PROCESS_NOT_FOUND CO_CODE(CO_MODULE_SYS, ESRCH)
136 #define CO_SYS_ER_FMT_PROCESS_NOT_FOUND \
137  "Can't find process %d."
138 
139 #define CO_SYS_ERR_PROCESS_NO_CHILDREN CO_CODE(CO_MODULE_SYS, ECHILD)
140 #define CO_SYS_ER_FMT_PROCESS_NO_CHILDREN \
141  "The process %d has no children."
142 
143 /* System resource errors */
144 
145 #define CO_SYS_ERR_NO_MEMORY CO_CODE(CO_MODULE_SYS, ENOMEM)
146 #define CO_SYS_ER_FMT_NO_MEMORY \
147  "Core memory is exhausted."
148 
149 #define CO_SYS_ERR_FILE_TABLE_OVERFLOW CO_CODE(CO_MODULE_SYS, ENFILE)
150 #define CO_SYS_ER_FMT_FILE_TABLE_OVERFLOW \
151  "Error opening `%s' -- the file table is full."
152 
153 #define CO_SYS_ERR_TOO_MANY_FILES CO_CODE(CO_MODULE_SYS, EMFILE)
154 #define CO_SYS_ER_FMT_TOO_MANY_FILES \
155  "Error opening `%s' -- there are too many open files."
156 
157 #define CO_SYS_ERR_NO_SPACE CO_CODE(CO_MODULE_SYS, ENOSPC)
158 #define CO_SYS_ER_FMT_NO_SPACE \
159  "Error writing `%s' -- no space left on device."
160 
161 #define CO_SYS_ERR_READ_ONLY_FS CO_CODE(CO_MODULE_SYS, EROFS)
162 #define CO_SYS_ER_FMT_READ_ONLY_FS \
163  "Error mounting `%s' -- the file system is read-only."
164 
165 #define CO_SYS_ERR_MSG_ID_REMOVED CO_CODE(CO_MODULE_SYS, EIDRM)
166 #define CO_SYS_ER_FMT_MSG_ID_REMOVED \
167  "The message id %d was removed."
168 
169 #define CO_SYS_ERR_DEADLOCK CO_CODE(CO_MODULE_SYS, EDEADLK)
170 #define CO_SYS_ER_FMT_DEADLOCK \
171  "A deadlock situation was detected and avoided."
172 
173 #define CO_SYS_ERR_UNABLE_TO_LOCK CO_CODE(CO_MODULE_SYS, ENOLCK)
174 #define CO_SYS_ER_FMT_UNABLE_TO_LOCK \
175  "Unable to lock file %d -- record table is full."
176 
177 /* Miscellaneous */
178 
179 #define CO_SYS_ERR_ARG_LIST_TOO_LONG CO_CODE(CO_MODULE_SYS, E2BIG)
180 #define CO_SYS_ER_FMT_ARG_LIST_TOO_LONG \
181  "The argument list for %s exceeds %d bytes."
182 
183 #define CO_SYS_ERR_BAD_ARG CO_CODE(CO_MODULE_SYS, EINVAL)
184 #define CO_SYS_ER_FMT_BAD_ARG \
185  "Invalid argument."
186 
187 #endif /* _CONDITION_HANDLER_ERR_H_ */