1 karl 1.17 //%2006////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.12 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.9 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.12 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.13 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.17 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 kumpf 1.1 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 kumpf 1.1 #ifndef Pegasus_InternalException_h
35 #define Pegasus_InternalException_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/Linkage.h>
39 #include <Pegasus/Common/Exception.h>
|
40 jim.wunderlich 1.14 #include <Pegasus/Common/PegasusAssert.h>
41
|
42 kumpf 1.1 PEGASUS_NAMESPACE_BEGIN
43
44 /** Class AssertionFailureException
45 This is an Exception class tied to the definiton of an assert named
46 PEGASUS_ASSERT. This assertion can be included at any point in Pegasus
47 code
48 */
49 class PEGASUS_COMMON_LINKAGE AssertionFailureException : public Exception
50 {
51 public:
52
53 AssertionFailureException(
|
54 kumpf 1.21 const char* file,
55 size_t line,
56 const String& message);
|
57 mike 1.19
58 virtual ~AssertionFailureException();
|
59 kumpf 1.1 };
60
61
62 /* Macro to Create the equivalent of an assert but without the
63 termination. This can be used as a temporary marker for asserts
64 that are not working. Prints out the error but continues.
65 NOTE: This is useful in test programs to keep us aware that we
66 have problems without halting the test sequence.
67 This was created primarily to put temporary asserts into tests that
68 are not yet working correctly but will not stop the test sequence.
69 */
70 #define ASSERTTEMP(COND) \
71 do \
72 { \
|
73 kumpf 1.21 if (!(COND)) \
74 { \
75 cerr << "TEMP Assert Error TEMP **********" \
76 <<__FILE__ << " " << __LINE__ \
77 << " " << #COND << endl; \
78 } \
|
79 kumpf 1.1 } while (0)
80
81
82 // ATTN: P3 KS documentation Required
83 class PEGASUS_COMMON_LINKAGE NullPointer : public Exception
84 {
85 public:
86
87 static const char MSG[];
|
88 kumpf 1.22 static const char KEY[];
|
89 kumpf 1.1
|
90 mike 1.19 NullPointer();
|
91 chuck 1.5
|
92 mike 1.19 virtual ~NullPointer();
|
93 kumpf 1.1 };
94
95 // ATTN: P3 KS documentation Required
96 class PEGASUS_COMMON_LINKAGE UndeclaredQualifier : public Exception
97 {
98 public:
99
100 static const char MSG[];
|
101 kumpf 1.22 static const char KEY[];
|
102 kumpf 1.1
|
103 mike 1.19 UndeclaredQualifier(const String& qualifierName) ;
|
104 chuck 1.5
|
105 mike 1.19 virtual ~UndeclaredQualifier();
|
106 kumpf 1.1 };
107
108 // ATTN: P3 KS documentation Required
109 class PEGASUS_COMMON_LINKAGE BadQualifierScope : public Exception
110 {
111 public:
112
|
113 kumpf 1.22 static const char MSG[];
114 static const char KEY[];
|
115 kumpf 1.1
|
116 mike 1.19 BadQualifierScope(
|
117 kumpf 1.22 const String& qualifierName,
|
118 kumpf 1.21 const String& scopeString);
|
119 chuck 1.5
|
120 mike 1.19 virtual ~BadQualifierScope();
|
121 kumpf 1.1 };
122
123 // ATTN: P3 KS documentation Required
124 class PEGASUS_COMMON_LINKAGE BadQualifierOverride : public Exception
125 {
126 public:
127
128 static const char MSG[];
|
129 kumpf 1.22 static const char KEY[];
|
130 kumpf 1.1
|
131 mike 1.19 BadQualifierOverride(const String& qualifierName);
132
133 virtual ~BadQualifierOverride();
|
134 kumpf 1.1 };
135
136 class PEGASUS_COMMON_LINKAGE BadQualifierType : public Exception
137 {
138 public:
139
140 static const char MSG[];
|
141 kumpf 1.22 static const char KEY[];
|
142 kumpf 1.1
|
143 mike 1.19 BadQualifierType(const String& qualifierName);
144 virtual ~BadQualifierType();
|
145 kumpf 1.1 };
146
147 // ATTN: P3 KS documentation Required
148 class PEGASUS_COMMON_LINKAGE InstantiatedAbstractClass : public Exception
149 {
150 public:
151
152 static const char MSG[];
|
153 kumpf 1.22 static const char KEY[];
|
154 kumpf 1.1
|
155 mike 1.19 InstantiatedAbstractClass(const String& className);
156 virtual ~InstantiatedAbstractClass();
|
157 kumpf 1.1 };
158
159 // ATTN: P3 KS documentation Required
160 class PEGASUS_COMMON_LINKAGE NoSuchProperty : public Exception
161 {
162 public:
163
164 static const char MSG[];
|
165 kumpf 1.22 static const char KEY[];
|
166 kumpf 1.1
|
167 mike 1.19 NoSuchProperty(const String& propertyName);
168 virtual ~NoSuchProperty();
|
169 kumpf 1.1 };
170
171 // ATTN: P3 KS documentation Required
172 class PEGASUS_COMMON_LINKAGE NoSuchFile : public Exception
173 {
174 public:
175
176 static const char MSG[];
|
177 kumpf 1.22 static const char KEY[];
|
178 kumpf 1.1
|
179 mike 1.19 NoSuchFile(const String& fileName);
180 virtual ~NoSuchFile();
|
181 kumpf 1.1 };
182
183 // ATTN: P3 KS documentation Required
184 class PEGASUS_COMMON_LINKAGE FileNotReadable : public Exception
185 {
186 public:
187
188 static const char MSG[];
|
189 kumpf 1.22 static const char KEY[];
|
190 kumpf 1.1
|
191 mike 1.19 FileNotReadable(const String& fileName);
192 virtual ~FileNotReadable();
|
193 kumpf 1.1 };
194
195 // ATTN: P3 KS documentation Required
196 class PEGASUS_COMMON_LINKAGE CannotRemoveDirectory : public Exception
197 {
198 public:
199
200 static const char MSG[];
|
201 kumpf 1.22 static const char KEY[];
|
202 kumpf 1.1
|
203 mike 1.19 CannotRemoveDirectory(const String& path);
204 virtual ~CannotRemoveDirectory();
|
205 kumpf 1.1 };
206
207 // ATTN: P3 KS documentation Required
208 class PEGASUS_COMMON_LINKAGE CannotRemoveFile : public Exception
209 {
210 public:
211
212 static const char MSG[];
|
213 kumpf 1.22 static const char KEY[];
|
214 kumpf 1.1
|
215 mike 1.19 CannotRemoveFile(const String& path);
216 virtual ~CannotRemoveFile();
|
217 kumpf 1.1 };
218
219 // ATTN: P3 KS documentation Required
220 class PEGASUS_COMMON_LINKAGE CannotRenameFile : public Exception
221 {
222 public:
223
224 static const char MSG[];
|
225 kumpf 1.22 static const char KEY[];
|
226 kumpf 1.1
|
227 mike 1.19 CannotRenameFile(const String& path);
228 virtual ~CannotRenameFile();
|
229 kumpf 1.1 };
230
231 // ATTN: P3 KS documentation Required
232 class PEGASUS_COMMON_LINKAGE NoSuchDirectory : public Exception
233 {
234 public:
235
236 static const char MSG[];
|
237 kumpf 1.22 static const char KEY[];
|
238 kumpf 1.1
|
239 mike 1.19 NoSuchDirectory(const String& directoryName);
240 virtual ~NoSuchDirectory();
|
241 kumpf 1.1 };
242
243 // ATTN: P3 KS documentation Required
244 class PEGASUS_COMMON_LINKAGE CannotCreateDirectory : public Exception
245 {
246 public:
247
248 static const char MSG[];
|
249 kumpf 1.22 static const char KEY[];
|
250 kumpf 1.1
|
251 mike 1.19 CannotCreateDirectory(const String& path);
252 virtual ~CannotCreateDirectory();
|
253 kumpf 1.1 };
254
255 // ATTN: P3 KS documentation Required
256 class PEGASUS_COMMON_LINKAGE CannotOpenFile : public Exception
257 {
258 public:
259
260 static const char MSG[];
|
261 kumpf 1.22 static const char KEY[];
|
262 kumpf 1.1
|
263 mike 1.19 CannotOpenFile(const String& path);
264 virtual ~CannotOpenFile();
|
265 kumpf 1.1 };
266
267 // ATTN: P3 KS documentation Required
268 class PEGASUS_COMMON_LINKAGE NotImplemented : public Exception
269 {
270 public:
271
272 static const char MSG[];
|
273 kumpf 1.22 static const char KEY[];
|
274 kumpf 1.1
|
275 mike 1.19 NotImplemented(const String& method);
276 virtual ~NotImplemented();
|
277 kumpf 1.1 };
278
279 class PEGASUS_COMMON_LINKAGE StackUnderflow : public Exception
280 {
281 public:
282
283 static const char MSG[];
|
284 kumpf 1.22 static const char KEY[];
|
285 kumpf 1.1
|
286 mike 1.19 StackUnderflow();
287 virtual ~StackUnderflow();
|
288 kumpf 1.1 };
289
290 class PEGASUS_COMMON_LINKAGE StackOverflow : public Exception
291 {
292 public:
293
294 static const char MSG[];
|
295 kumpf 1.22 static const char KEY[];
|
296 kumpf 1.1
|
297 mike 1.19 StackOverflow();
298 virtual ~StackOverflow();
|
299 kumpf 1.1 };
300
301 class PEGASUS_COMMON_LINKAGE DynamicLoadFailed : public Exception
302 {
303 public:
304
305 static const char MSG[];
|
306 kumpf 1.22 static const char KEY[];
|
307 kumpf 1.1
|
308 mike 1.19 DynamicLoadFailed(const String& libraryName);
309 virtual ~DynamicLoadFailed();
|
310 kumpf 1.1 };
311
312 class PEGASUS_COMMON_LINKAGE DynamicLookupFailed : public Exception
313 {
314 public:
315
316 static const char MSG[];
|
317 kumpf 1.22 static const char KEY[];
|
318 kumpf 1.1
|
319 mike 1.19 DynamicLookupFailed(const String& symbolName);
320 virtual ~DynamicLookupFailed();
|
321 kumpf 1.1 };
322
323 class PEGASUS_COMMON_LINKAGE CannotOpenDirectory : public Exception
324 {
325 public:
326
327 static const char MSG[];
|
328 kumpf 1.22 static const char KEY[];
|
329 kumpf 1.1
|
330 mike 1.19 CannotOpenDirectory(const String& path);
331 virtual ~CannotOpenDirectory();
|
332 kumpf 1.1 };
333
334 class PEGASUS_COMMON_LINKAGE ParseError : public Exception
335 {
336 public:
337
338 static const char MSG[];
|
339 kumpf 1.22 static const char KEY[];
|
340 kumpf 1.1
|
341 mike 1.19 ParseError(const String& message);
342 virtual ~ParseError();
|
343 kumpf 1.1 };
344
345 class PEGASUS_COMMON_LINKAGE MissingNullTerminator : public Exception
346 {
347 public:
348
349 static const char MSG[];
|
350 kumpf 1.22 static const char KEY[];
|
351 kumpf 1.1
|
352 mike 1.19 MissingNullTerminator();
353 virtual ~MissingNullTerminator();
|
354 chuck 1.5 };
355
356 class PEGASUS_COMMON_LINKAGE MalformedLanguageHeader: public Exception
357 {
358 public:
359
360 static const char MSG[];
|
361 kumpf 1.22 static const char KEY[];
|
362 chuck 1.5
|
363 mike 1.19 MalformedLanguageHeader(const String& error);
364 virtual ~MalformedLanguageHeader();
|
365 chuck 1.5 };
366
367 class PEGASUS_COMMON_LINKAGE InvalidAcceptLanguageHeader: public Exception
368 {
369 public:
370
371 static const char MSG[];
|
372 kumpf 1.22 static const char KEY[];
|
373 chuck 1.5
|
374 mike 1.19 InvalidAcceptLanguageHeader(const String& error);
375 virtual ~InvalidAcceptLanguageHeader();
|
376 kumpf 1.1 };
377
|
378 chuck 1.5 class PEGASUS_COMMON_LINKAGE InvalidContentLanguageHeader: public Exception
379 {
380 public:
381
382 static const char MSG[];
|
383 kumpf 1.22 static const char KEY[];
|
384 chuck 1.5
|
385 mike 1.19 InvalidContentLanguageHeader(const String& error);
386 virtual ~InvalidContentLanguageHeader();
|
387 chuck 1.5 };
388
|
389 kumpf 1.1 class PEGASUS_COMMON_LINKAGE InvalidAuthHeader: public Exception
390 {
391 public:
392
393 static const char MSG[];
|
394 kumpf 1.22 static const char KEY[];
|
395 kumpf 1.1
|
396 mike 1.19 InvalidAuthHeader();
397 virtual ~InvalidAuthHeader();
|
398 kumpf 1.1 };
399
400 class PEGASUS_COMMON_LINKAGE UnauthorizedAccess: public Exception
401 {
402 public:
403
404 static const char MSG[];
|
405 kumpf 1.22 static const char KEY[];
|
406 kumpf 1.1
|
407 mike 1.19 UnauthorizedAccess();
408 virtual ~UnauthorizedAccess();
|
409 kumpf 1.1 };
410
|
411 kumpf 1.4 class PEGASUS_COMMON_LINKAGE IncompatibleTypesException : public Exception
412 {
413 public:
|
414 kumpf 1.22 IncompatibleTypesException();
415 virtual ~IncompatibleTypesException();
|
416 kumpf 1.4 };
417
|
418 kumpf 1.10 class PEGASUS_COMMON_LINKAGE InternalSystemError : public Exception
419 {
420 public:
421
422 static const char MSG[];
423
|
424 mike 1.19 InternalSystemError();
425 virtual ~InternalSystemError();
|
426 kumpf 1.10 };
427
|
428 kumpf 1.4
|
429 kumpf 1.1 /** The CIMException defines the CIM exceptions that are formally defined in
|
430 kumpf 1.2 the CIM Operations over HTTP specification. TraceableCIMException allows
|
431 kumpf 1.1 file name and line number information to be added for diagnostic purposes.
432 */
|
433 kumpf 1.2 class PEGASUS_COMMON_LINKAGE TraceableCIMException : public CIMException
|
434 kumpf 1.1 {
435 public:
436
|
437 kumpf 1.2 TraceableCIMException(
|
438 kumpf 1.21 CIMStatusCode code,
439 const String& message,
440 const String& file,
441 Uint32 line);
442
443 TraceableCIMException(
444 CIMStatusCode code,
|
445 kumpf 1.23 const MessageLoaderParms& parms,
|
446 kumpf 1.21 const String& file,
447 Uint32 line);
448
449 TraceableCIMException(
450 const ContentLanguageList& langs,
451 CIMStatusCode code,
452 const String& message,
453 const String& file,
454 Uint32 line);
|
455 chuck 1.5
|
456 kumpf 1.2 TraceableCIMException(const CIMException & cimException);
457
458 String getDescription() const;
|
459 kumpf 1.1
460 String getTraceDescription() const;
|
461 kumpf 1.11
462 String getCIMMessage() const;
463 void setCIMMessage(const String& cimMessage);
464
465 String getFile() const;
466 Uint32 getLine() const;
|
467 kumpf 1.16 const ContentLanguageList& getContentLanguages() const;
|
468 kumpf 1.2 };
|
469 kumpf 1.1
|
470 kumpf 1.2 #define PEGASUS_CIM_EXCEPTION(CODE, EXTRA_MESSAGE) \
|
471 kumpf 1.11 TraceableCIMException(CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
|
472 chuck 1.5
473 #define PEGASUS_CIM_EXCEPTION_LANG(LANGS, CODE, EXTRA_MESSAGE) \
|
474 kumpf 1.11 TraceableCIMException( \
|
475 kumpf 1.22 LANGS, CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
476
|
477 humberto 1.7 #define PEGASUS_CIM_EXCEPTION_L(CODE, MSG_PARMS) \
|
478 kumpf 1.11 TraceableCIMException(CODE, MSG_PARMS, String(__FILE__), __LINE__)
|
479 kumpf 1.1
|
480 kumpf 1.22 /** Macro to prevent overflow of a signed int value when said value is
|
481 dave.sudlik 1.18 * doubled. If String/Array/Buffer size is greater than 0x3FFFFFFF, then
482 * something is suspect, throw bad_alloc exception.
483 */
484 #define PEGASUS_CHECK_CAPACITY_OVERFLOW(capacity) \
485 do \
486 { \
487 if (capacity > 0x3FFFFFFF) \
488 throw PEGASUS_STD(bad_alloc)(); \
489 } \
490 while (0)
491
|
492 marek 1.25 /** The following function CheckRep serves to reduce the function call
493 * overhead caused by calling a non-inlined function that only checks
494 * if a pointer is not NULL.
495 * The function ThrowUnitializedObjectException throws
496 * an UninitialisedObjectException.
497 * A function to throw the exception is used to reduce object size of
498 * function CheckRep which is inlined in many places across
499 * the common library.
500 */
501 PEGASUS_COMMON_LINKAGE extern void ThrowUninitializedObjectException();
502
503 inline void CheckRep(void * rep)
504 {
505 if (!rep)
506 ThrowUninitializedObjectException();
|
507 dmitry.mikulin 1.28 }
|
508 marek 1.25
|
509 kumpf 1.1 PEGASUS_NAMESPACE_END
510
511 #endif /* Pegasus_InternalException_h */
|