2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseExceptionInternal.cpp
19 * @brief This is the implementation file for Exception.
21 #include "FBase_Exception.h"
23 const char* ExceptionStrings[] =
27 "IndexOutOfBoundsException",
29 "InstanceAlreadyExistsException",
31 "IllegalArgumentException",
32 "IllegalAccessException",
33 "IllegalStateException",
35 "NullPointerException",
37 "UndefinedTypeException",
38 "NotImplementedException",
41 "DataFormatException",
44 "NetworkConnectionException",
45 "ArithmeticException",
49 "EndofGeneralExcpetion",
52 "CreateFailedException",
54 "NoSuchInstanceException",
55 "ComponentNotFoundException",
56 "MethodNotFoundException",
57 "InterfaceNotFoundException",
58 "SectionNotFoundException",
59 "EntryNotFoundException",
60 "ValueNotAssignedException",
61 "InvalidDocumentException",
63 "FileLongPathException",
64 "FileInvalidPathException",
65 "FileNotFoundException",
66 "FileAlreadyExistException",
67 "FileEndOfFileException",
68 "FilePermissionException",
69 "FileNotEmptyDirException",
70 "FileOpenLimitExceededException",
71 "FileCorruptedException",
72 "FileVolumeFullException",
73 "FileQuotaExceededException",
74 "FileDeviceFailureException",
75 "FileVolumeNotMountedException",
76 "FileMediaEjectedException",
79 "KeyNotFoundException",
80 "ActorNotFoundException",
81 "ContextModelNotFoundException",
82 "ListenerNotFoundException",
83 "ChannelNotFoundException",
85 "IpcProxyMethodException",
86 "IpcStubMethodException",
87 "StubIsAlreadyRunning",
90 "NoSuchProxyConnected",
93 "IpcUserDataAlreadyExist",
94 "IpcStubNoUserDataFound",
95 "IpcAddListenerDenied",
97 "IpcInterfaceNotFound",
99 "IPCAllIpcCallSlotIsUsing",
101 "IpcMsgQueueNotFound",
103 "DatabaseErrorException",
104 "DatabaseTooBigException",
105 "DatabaseBusyException",
106 "DatabaseEndOfResultSet",
107 "DatabaseNotChangedException",
111 "EncodingFailedException",
112 "DecodingFailedException",
114 "EndofBaseException",
120 "ServiceAlreadyRegisteredException",
121 "XmlParsingException",
122 "ServiceNotRegisteredException",
123 "EventSourceNotRegisteredException",
125 "InvalidPeerCredentialException",
126 "UnSupportedProtocolException",
127 "UnSupportedEncodingException",
129 "InvalidMessageTypeException",
130 "NetworkAbortException",
131 "NetworkAlreadyAbortedException",
132 "NetworkAbortFailedException",
133 "EndofServiceException",
136 "GroupNotFoundException",
137 "UserNotFoundException",
138 "ServiceNotFoundException",
139 "AttributeNotFoundException",
140 "DuplicateAttributeException",
141 "AlreadyJoinedGroupException",
142 "NotJoinedGroupException",
143 "AlreadyInvitedException",
144 "InvitationNotFoundException",
145 "MaxMemberExceededException",
146 "NotPermittedGenderException",
147 "CategoryNotFoundException",
148 "DuplicateJoinRequestException",
149 "JoinProhibitedException",
150 "DuplicateGroupNameException",
151 "EndofGroupException",
154 // security exception
155 "SignFailedException",
156 "InvalidSignatureException",
157 "VersionNotMatchException",
159 "AmbiguousCredentialException",
160 "CredentialNotFoundException",
162 "AlreadyUserRegisteredException",
163 "UserNotRegisteredException",
164 "AlreadyUserAuthenticatedException",
165 "UserNotAuthenticatedException",
166 "UserIDNotMatchedException",
168 "EncryptFailedException",
169 "DecryptFailedException",
170 "HMACFailedException",
171 "RandomByteFailedException",
172 "HashFailedException",
173 "PasswordNotMatchedException",
175 "PrivilegeDeniedException",
177 "EndofSecurityException,",
181 "PathNotFoundException",
182 "PathAlreadyExistException",
184 "EndofStorageException",
187 "ContextModelCountMaxException",
188 "DataNotFoundException",
190 "InvalidSensorCIDException",
191 "ObjectDataNotFoundException",
192 "IllegalConditionObjectException",
193 "IllegalConditionChannelException",
194 "InvalidModelDefinitionException",
195 "NoSuchTableException",
196 "ServiceUnavailableException",
197 "ContextStorageNotFoundException",
198 "ContextStorageExistException",
199 "ContextTypeNotFoundException",
200 "ContextStorageNotOpenedException",
201 "ContextStorageNotClosedException",
202 "ContextElementNotFoundException",
203 "CursorNotDeletedException",
205 "CanNotLaunchServerException",
206 "CanNotAllocResourceException",
207 "TooManyOnGoingSessionsException",
208 "CanNotDecodeException",
209 "InvalidEncodeTypeException",
210 "NeedCoProcessorException",
211 "CoProcessingException",
212 "CaughtBrokenInternalsException",
213 "CaughtIncompleteCodeException",
214 "NotCQPEnabledDeviceNameException",
215 "CanNotFindEntityException",
216 "ExceedMaximumBufferLimitException",
217 "RemoteExecuteQueryException",
219 "InvalidHandleException",
220 "SessionAlreadyInProgressException",
221 "ExceedMaximumHandleCountException",
222 "TooManyOnGoingTasksException",
223 "InvalidCqlStatementException",
224 "TypeMissMatchingException",
225 "AlreadyRegisteredException",
226 "LoadingCsr256FailedException",
227 "EndofResultSetException",
228 "NotSupportedOperationException",
229 "HandleClosedByOtherThreadException",
230 "RequestCanceledByOtherThreadException",
231 "QueryExecutionNotCompletedException",
232 "InvalidCursorObjectException",
233 "TriggerFiredException",
234 "InvalidCursorPositionException",
235 "EmptyCursorObjectException",
236 "OpenedHandleExistException",
238 // context importer exception
239 "DBConnectionFailedException",
240 "SQLExecutionFailedException",
243 "TagNotFoundException",
244 "TagLoginFailedException",
246 "NoDataOnTagException",
247 "IncompatibleTagException",
248 "TagLockedException",
250 "EndofContextException",
252 // Second life exceptions
253 "NotLoggedInException",
254 "BalanceNotReceivedException",
255 "NotEnoughBalanceException",
257 "OutOfBoundaryException",
258 "UnsupportedException",
259 "TeleportInProgressException",
260 "MovementInProgressException",
261 "RequestAlreadyInProgressException",
263 "InventoryDataNotReceivedException",
264 "MaximumGroupJoinLimitException",
266 "EndofSecondlifeException",
268 // "CacheFullException",
270 // location services exception
274 "LandmarkMaxNumberExceededException",
275 "LocationServiceException",
276 "LocationServiceInterruptedException",
278 "EndofLocationException",
280 "CacheFullException",
282 "EndofEMSClientException",
285 "OSPSyncProfileNotExistException",
286 "InvalidDeviceInformationException",
287 "InvalidSequenceNumberException",
288 "NoLocalDeviceInformationException",
289 "NoLocalSequenceNumberException",
290 "NoSuchDeviceException",
291 "NoSuchOperationException",
292 "NoDeviceResponseListenerException",
293 "RequiredParameterMissing",
295 // Device Synchronization
296 "DataSyncNetworkFailureException",
297 "NoActiveChangeLogException",
298 "NoActiveSyncSessionException",
299 "NoSuchAppDataFolderException",
300 "NoSuchSyncSessionException",
301 "SyncInProgressException",
302 "DeviceOperationFailureException",
303 "DBReadFailureException",
304 "NoSuchChangeObjectException",
306 // Device Management Exception
307 "NoSuchApplicationIDException",
308 "NoSuchURIException",
309 "NoSuchScheduleException",
310 "NoSuchNodeException",
311 "NoSuchNodeDataException",
312 "InvalidParameterException",
314 "EndofDeviceException",
316 "UndefinedException" // for exception handling
320 * Returns a string representation of the specified exception. It is useful when printing out a caught exception.
322 * @param[in] e exception to query.
325 ExceptionToString(Exception e)
327 if (e < 0 || e > UNDEFINED_EXCEPTION)
329 e = UNDEFINED_EXCEPTION;
331 return ExceptionStrings[EXCEPTION_INDEX(e)];