2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FBaseExceptionInternal.cpp
20 * @brief This is the implementation file for Exception.
23 #include "FBase_Exception.h"
25 const char* ExceptionStrings[] =
29 "IndexOutOfBoundsException",
31 "InstanceAlreadyExistsException",
33 "IllegalArgumentException",
34 "IllegalAccessException",
35 "IllegalStateException",
37 "NullPointerException",
39 "UndefinedTypeException",
40 "NotImplementedException",
43 "DataFormatException",
46 "NetworkConnectionException",
47 "ArithmeticException",
51 "EndofGeneralExcpetion",
54 "CreateFailedException",
56 "NoSuchInstanceException",
57 "ComponentNotFoundException",
58 "MethodNotFoundException",
59 "InterfaceNotFoundException",
60 "SectionNotFoundException",
61 "EntryNotFoundException",
62 "ValueNotAssignedException",
63 "InvalidDocumentException",
65 "FileLongPathException",
66 "FileInvalidPathException",
67 "FileNotFoundException",
68 "FileAlreadyExistException",
69 "FileEndOfFileException",
70 "FilePermissionException",
71 "FileNotEmptyDirException",
72 "FileOpenLimitExceededException",
73 "FileCorruptedException",
74 "FileVolumeFullException",
75 "FileQuotaExceededException",
76 "FileDeviceFailureException",
77 "FileVolumeNotMountedException",
78 "FileMediaEjectedException",
81 "KeyNotFoundException",
82 "ActorNotFoundException",
83 "ContextModelNotFoundException",
84 "ListenerNotFoundException",
85 "ChannelNotFoundException",
87 "IpcProxyMethodException",
88 "IpcStubMethodException",
89 "StubIsAlreadyRunning",
92 "NoSuchProxyConnected",
95 "IpcUserDataAlreadyExist",
96 "IpcStubNoUserDataFound",
97 "IpcAddListenerDenied",
99 "IpcInterfaceNotFound",
100 "IpcNoListenerFound",
101 "IPCAllIpcCallSlotIsUsing",
103 "IpcMsgQueueNotFound",
105 "DatabaseErrorException",
106 "DatabaseTooBigException",
107 "DatabaseBusyException",
108 "DatabaseEndOfResultSet",
109 "DatabaseNotChangedException",
113 "EncodingFailedException",
114 "DecodingFailedException",
116 "EndofBaseException",
122 "ServiceAlreadyRegisteredException",
123 "XmlParsingException",
124 "ServiceNotRegisteredException",
125 "EventSourceNotRegisteredException",
127 "InvalidPeerCredentialException",
128 "UnSupportedProtocolException",
129 "UnSupportedEncodingException",
131 "InvalidMessageTypeException",
132 "NetworkAbortException",
133 "NetworkAlreadyAbortedException",
134 "NetworkAbortFailedException",
135 "EndofServiceException",
138 "GroupNotFoundException",
139 "UserNotFoundException",
140 "ServiceNotFoundException",
141 "AttributeNotFoundException",
142 "DuplicateAttributeException",
143 "AlreadyJoinedGroupException",
144 "NotJoinedGroupException",
145 "AlreadyInvitedException",
146 "InvitationNotFoundException",
147 "MaxMemberExceededException",
148 "NotPermittedGenderException",
149 "CategoryNotFoundException",
150 "DuplicateJoinRequestException",
151 "JoinProhibitedException",
152 "DuplicateGroupNameException",
153 "EndofGroupException",
156 // security exception
157 "SignFailedException",
158 "InvalidSignatureException",
159 "VersionNotMatchException",
161 "AmbiguousCredentialException",
162 "CredentialNotFoundException",
164 "AlreadyUserRegisteredException",
165 "UserNotRegisteredException",
166 "AlreadyUserAuthenticatedException",
167 "UserNotAuthenticatedException",
168 "UserIDNotMatchedException",
170 "EncryptFailedException",
171 "DecryptFailedException",
172 "HMACFailedException",
173 "RandomByteFailedException",
174 "HashFailedException",
175 "PasswordNotMatchedException",
177 "PrivilegeDeniedException",
179 "EndofSecurityException,",
183 "PathNotFoundException",
184 "PathAlreadyExistException",
186 "EndofStorageException",
189 "ContextModelCountMaxException",
190 "DataNotFoundException",
192 "InvalidSensorCIDException",
193 "ObjectDataNotFoundException",
194 "IllegalConditionObjectException",
195 "IllegalConditionChannelException",
196 "InvalidModelDefinitionException",
197 "NoSuchTableException",
198 "ServiceUnavailableException",
199 "ContextStorageNotFoundException",
200 "ContextStorageExistException",
201 "ContextTypeNotFoundException",
202 "ContextStorageNotOpenedException",
203 "ContextStorageNotClosedException",
204 "ContextElementNotFoundException",
205 "CursorNotDeletedException",
207 "CanNotLaunchServerException",
208 "CanNotAllocResourceException",
209 "TooManyOnGoingSessionsException",
210 "CanNotDecodeException",
211 "InvalidEncodeTypeException",
212 "NeedCoProcessorException",
213 "CoProcessingException",
214 "CaughtBrokenInternalsException",
215 "CaughtIncompleteCodeException",
216 "NotCQPEnabledDeviceNameException",
217 "CanNotFindEntityException",
218 "ExceedMaximumBufferLimitException",
219 "RemoteExecuteQueryException",
221 "InvalidHandleException",
222 "SessionAlreadyInProgressException",
223 "ExceedMaximumHandleCountException",
224 "TooManyOnGoingTasksException",
225 "InvalidCqlStatementException",
226 "TypeMissMatchingException",
227 "AlreadyRegisteredException",
228 "LoadingCsr256FailedException",
229 "EndofResultSetException",
230 "NotSupportedOperationException",
231 "HandleClosedByOtherThreadException",
232 "RequestCanceledByOtherThreadException",
233 "QueryExecutionNotCompletedException",
234 "InvalidCursorObjectException",
235 "TriggerFiredException",
236 "InvalidCursorPositionException",
237 "EmptyCursorObjectException",
238 "OpenedHandleExistException",
240 // context importer exception
241 "DBConnectionFailedException",
242 "SQLExecutionFailedException",
245 "TagNotFoundException",
246 "TagLoginFailedException",
248 "NoDataOnTagException",
249 "IncompatibleTagException",
250 "TagLockedException",
252 "EndofContextException",
254 // Second life exceptions
255 "NotLoggedInException",
256 "BalanceNotReceivedException",
257 "NotEnoughBalanceException",
259 "OutOfBoundaryException",
260 "UnsupportedException",
261 "TeleportInProgressException",
262 "MovementInProgressException",
263 "RequestAlreadyInProgressException",
265 "InventoryDataNotReceivedException",
266 "MaximumGroupJoinLimitException",
268 "EndofSecondlifeException",
270 // "CacheFullException",
272 // location services exception
276 "LandmarkMaxNumberExceededException",
277 "LocationServiceException",
278 "LocationServiceInterruptedException",
280 "EndofLocationException",
282 "CacheFullException",
284 "EndofEMSClientException",
287 "OSPSyncProfileNotExistException",
288 "InvalidDeviceInformationException",
289 "InvalidSequenceNumberException",
290 "NoLocalDeviceInformationException",
291 "NoLocalSequenceNumberException",
292 "NoSuchDeviceException",
293 "NoSuchOperationException",
294 "NoDeviceResponseListenerException",
295 "RequiredParameterMissing",
297 // Device Synchronization
298 "DataSyncNetworkFailureException",
299 "NoActiveChangeLogException",
300 "NoActiveSyncSessionException",
301 "NoSuchAppDataFolderException",
302 "NoSuchSyncSessionException",
303 "SyncInProgressException",
304 "DeviceOperationFailureException",
305 "DBReadFailureException",
306 "NoSuchChangeObjectException",
308 // Device Management Exception
309 "NoSuchApplicationIDException",
310 "NoSuchURIException",
311 "NoSuchScheduleException",
312 "NoSuchNodeException",
313 "NoSuchNodeDataException",
314 "InvalidParameterException",
316 "EndofDeviceException",
318 "UndefinedException" // for exception handling
323 * Returns a string representation of the specified exception. It is useful when printing out a caught exception.
325 * @param[in] e exception to query.
328 ExceptionToString(Exception e)
330 if (e < 0 || e > UNDEFINED_EXCEPTION)
332 e = UNDEFINED_EXCEPTION;
334 return ExceptionStrings[EXCEPTION_INDEX(e)];