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 ClassAlreadyResolved : 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 ClassAlreadyResolved(const String& className);
156
157 virtual ~ClassAlreadyResolved();
|
158 kumpf 1.1 };
159
160 // ATTN: P3 KS documentation Required
161 class PEGASUS_COMMON_LINKAGE ClassNotResolved : public Exception
162 {
163 public:
164
165 static const char MSG[];
|
166 kumpf 1.22 static const char KEY[];
|
167 kumpf 1.1
|
168 mike 1.19 ClassNotResolved(const String& className);
169 virtual ~ClassNotResolved();
|
170 kumpf 1.1 };
171
172 // ATTN: P3 KS documentation Required
173 class PEGASUS_COMMON_LINKAGE InstanceAlreadyResolved : public Exception
174 {
175 public:
176
177 static const char MSG[];
|
178 kumpf 1.22 static const char KEY[];
|
179 kumpf 1.1
|
180 mike 1.19 InstanceAlreadyResolved();
181 virtual ~InstanceAlreadyResolved();
|
182 kumpf 1.1 };
183
184 // ATTN: P3 KS documentation Required
185 class PEGASUS_COMMON_LINKAGE InstantiatedAbstractClass : public Exception
186 {
187 public:
188
189 static const char MSG[];
|
190 kumpf 1.22 static const char KEY[];
|
191 kumpf 1.1
|
192 mike 1.19 InstantiatedAbstractClass(const String& className);
193 virtual ~InstantiatedAbstractClass();
|
194 kumpf 1.1 };
195
196 // ATTN: P3 KS documentation Required
197 class PEGASUS_COMMON_LINKAGE NoSuchProperty : public Exception
198 {
199 public:
200
201 static const char MSG[];
|
202 kumpf 1.22 static const char KEY[];
|
203 kumpf 1.1
|
204 mike 1.19 NoSuchProperty(const String& propertyName);
205 virtual ~NoSuchProperty();
|
206 kumpf 1.1 };
207
208 // ATTN: P3 KS documentation Required
209 class PEGASUS_COMMON_LINKAGE NoSuchFile : public Exception
210 {
211 public:
212
213 static const char MSG[];
|
214 kumpf 1.22 static const char KEY[];
|
215 kumpf 1.1
|
216 mike 1.19 NoSuchFile(const String& fileName);
217 virtual ~NoSuchFile();
|
218 kumpf 1.1 };
219
220 // ATTN: P3 KS documentation Required
221 class PEGASUS_COMMON_LINKAGE FileNotReadable : public Exception
222 {
223 public:
224
225 static const char MSG[];
|
226 kumpf 1.22 static const char KEY[];
|
227 kumpf 1.1
|
228 mike 1.19 FileNotReadable(const String& fileName);
229 virtual ~FileNotReadable();
|
230 kumpf 1.1 };
231
232 // ATTN: P3 KS documentation Required
233 class PEGASUS_COMMON_LINKAGE CannotRemoveDirectory : public Exception
234 {
235 public:
236
237 static const char MSG[];
|
238 kumpf 1.22 static const char KEY[];
|
239 kumpf 1.1
|
240 mike 1.19 CannotRemoveDirectory(const String& path);
241 virtual ~CannotRemoveDirectory();
|
242 kumpf 1.1 };
243
244 // ATTN: P3 KS documentation Required
245 class PEGASUS_COMMON_LINKAGE CannotRemoveFile : public Exception
246 {
247 public:
248
249 static const char MSG[];
|
250 kumpf 1.22 static const char KEY[];
|
251 kumpf 1.1
|
252 mike 1.19 CannotRemoveFile(const String& path);
253 virtual ~CannotRemoveFile();
|
254 kumpf 1.1 };
255
256 // ATTN: P3 KS documentation Required
257 class PEGASUS_COMMON_LINKAGE CannotRenameFile : public Exception
258 {
259 public:
260
261 static const char MSG[];
|
262 kumpf 1.22 static const char KEY[];
|
263 kumpf 1.1
|
264 mike 1.19 CannotRenameFile(const String& path);
265 virtual ~CannotRenameFile();
|
266 kumpf 1.1 };
267
268 // ATTN: P3 KS documentation Required
269 class PEGASUS_COMMON_LINKAGE NoSuchDirectory : public Exception
270 {
271 public:
272
273 static const char MSG[];
|
274 kumpf 1.22 static const char KEY[];
|
275 kumpf 1.1
|
276 mike 1.19 NoSuchDirectory(const String& directoryName);
277 virtual ~NoSuchDirectory();
|
278 kumpf 1.1 };
279
280 // ATTN: P3 KS documentation Required
281 class PEGASUS_COMMON_LINKAGE CannotCreateDirectory : public Exception
282 {
283 public:
284
285 static const char MSG[];
|
286 kumpf 1.22 static const char KEY[];
|
287 kumpf 1.1
|
288 mike 1.19 CannotCreateDirectory(const String& path);
289 virtual ~CannotCreateDirectory();
|
290 kumpf 1.1 };
291
292 // ATTN: P3 KS documentation Required
293 class PEGASUS_COMMON_LINKAGE CannotOpenFile : public Exception
294 {
295 public:
296
297 static const char MSG[];
|
298 kumpf 1.22 static const char KEY[];
|
299 kumpf 1.1
|
300 mike 1.19 CannotOpenFile(const String& path);
301 virtual ~CannotOpenFile();
|
302 kumpf 1.1 };
303
304 // ATTN: P3 KS documentation Required
305 class PEGASUS_COMMON_LINKAGE NotImplemented : public Exception
306 {
307 public:
308
309 static const char MSG[];
|
310 kumpf 1.22 static const char KEY[];
|
311 kumpf 1.1
|
312 mike 1.19 NotImplemented(const String& method);
313 virtual ~NotImplemented();
|
314 kumpf 1.1 };
315
316 class PEGASUS_COMMON_LINKAGE StackUnderflow : public Exception
317 {
318 public:
319
320 static const char MSG[];
|
321 kumpf 1.22 static const char KEY[];
|
322 kumpf 1.1
|
323 mike 1.19 StackUnderflow();
324 virtual ~StackUnderflow();
|
325 kumpf 1.1 };
326
327 class PEGASUS_COMMON_LINKAGE StackOverflow : public Exception
328 {
329 public:
330
331 static const char MSG[];
|
332 kumpf 1.22 static const char KEY[];
|
333 kumpf 1.1
|
334 mike 1.19 StackOverflow();
335 virtual ~StackOverflow();
|
336 kumpf 1.1 };
337
338 class PEGASUS_COMMON_LINKAGE BadFormat : public Exception
339 {
340 public:
341
342 static const char MSG[];
|
343 kumpf 1.22 static const char KEY[];
|
344 kumpf 1.1
|
345 mike 1.19 BadFormat();
346 virtual ~BadFormat();
|
347 kumpf 1.1 };
348
349 class PEGASUS_COMMON_LINKAGE BadlyFormedCGIQueryString : public Exception
350 {
351 public:
352
353 static const char MSG[];
|
354 kumpf 1.22 static const char KEY[];
|
355 kumpf 1.1
|
356 mike 1.19 BadlyFormedCGIQueryString();
357 virtual ~BadlyFormedCGIQueryString();
|
358 kumpf 1.1 };
359
360 class PEGASUS_COMMON_LINKAGE DynamicLoadFailed : public Exception
361 {
362 public:
363
364 static const char MSG[];
|
365 kumpf 1.22 static const char KEY[];
|
366 kumpf 1.1
|
367 mike 1.19 DynamicLoadFailed(const String& libraryName);
368 virtual ~DynamicLoadFailed();
|
369 kumpf 1.1 };
370
371 class PEGASUS_COMMON_LINKAGE DynamicLookupFailed : public Exception
372 {
373 public:
374
375 static const char MSG[];
|
376 kumpf 1.22 static const char KEY[];
|
377 kumpf 1.1
|
378 mike 1.19 DynamicLookupFailed(const String& symbolName);
379 virtual ~DynamicLookupFailed();
|
380 kumpf 1.1 };
381
382 class PEGASUS_COMMON_LINKAGE CannotOpenDirectory : public Exception
383 {
384 public:
385
386 static const char MSG[];
|
387 kumpf 1.22 static const char KEY[];
|
388 kumpf 1.1
|
389 mike 1.19 CannotOpenDirectory(const String& path);
390 virtual ~CannotOpenDirectory();
|
391 kumpf 1.1 };
392
393 class PEGASUS_COMMON_LINKAGE ParseError : public Exception
394 {
395 public:
396
397 static const char MSG[];
|
398 kumpf 1.22 static const char KEY[];
|
399 kumpf 1.1
|
400 mike 1.19 ParseError(const String& message);
401 virtual ~ParseError();
|
402 kumpf 1.1 };
403
404 class PEGASUS_COMMON_LINKAGE MissingNullTerminator : public Exception
405 {
406 public:
407
408 static const char MSG[];
|
409 kumpf 1.22 static const char KEY[];
|
410 kumpf 1.1
|
411 mike 1.19 MissingNullTerminator();
412 virtual ~MissingNullTerminator();
|
413 chuck 1.5 };
414
415 class PEGASUS_COMMON_LINKAGE MalformedLanguageHeader: public Exception
416 {
417 public:
418
419 static const char MSG[];
|
420 kumpf 1.22 static const char KEY[];
|
421 chuck 1.5
|
422 mike 1.19 MalformedLanguageHeader(const String& error);
423 virtual ~MalformedLanguageHeader();
|
424 chuck 1.5 };
425
426 class PEGASUS_COMMON_LINKAGE InvalidAcceptLanguageHeader: public Exception
427 {
428 public:
429
430 static const char MSG[];
|
431 kumpf 1.22 static const char KEY[];
|
432 chuck 1.5
|
433 mike 1.19 InvalidAcceptLanguageHeader(const String& error);
434 virtual ~InvalidAcceptLanguageHeader();
|
435 kumpf 1.1 };
436
|
437 chuck 1.5 class PEGASUS_COMMON_LINKAGE InvalidContentLanguageHeader: public Exception
438 {
439 public:
440
441 static const char MSG[];
|
442 kumpf 1.22 static const char KEY[];
|
443 chuck 1.5
|
444 mike 1.19 InvalidContentLanguageHeader(const String& error);
445 virtual ~InvalidContentLanguageHeader();
|
446 chuck 1.5 };
447
|
448 kumpf 1.1 class PEGASUS_COMMON_LINKAGE InvalidAuthHeader: public Exception
449 {
450 public:
451
452 static const char MSG[];
|
453 kumpf 1.22 static const char KEY[];
|
454 kumpf 1.1
|
455 mike 1.19 InvalidAuthHeader();
456 virtual ~InvalidAuthHeader();
|
457 kumpf 1.1 };
458
459 class PEGASUS_COMMON_LINKAGE UnauthorizedAccess: public Exception
460 {
461 public:
462
463 static const char MSG[];
|
464 kumpf 1.22 static const char KEY[];
|
465 kumpf 1.1
|
466 mike 1.19 UnauthorizedAccess();
467 virtual ~UnauthorizedAccess();
|
468 kumpf 1.1 };
469
|
470 kumpf 1.4 class PEGASUS_COMMON_LINKAGE IncompatibleTypesException : public Exception
471 {
472 public:
|
473 kumpf 1.22 IncompatibleTypesException();
474 virtual ~IncompatibleTypesException();
|
475 kumpf 1.4 };
476
|
477 kumpf 1.10 class PEGASUS_COMMON_LINKAGE InternalSystemError : public Exception
478 {
479 public:
480
481 static const char MSG[];
482
|
483 mike 1.19 InternalSystemError();
484 virtual ~InternalSystemError();
|
485 kumpf 1.10 };
486
|
487 kumpf 1.4
|
488 kumpf 1.1 /** The CIMException defines the CIM exceptions that are formally defined in
|
489 kumpf 1.2 the CIM Operations over HTTP specification. TraceableCIMException allows
|
490 kumpf 1.1 file name and line number information to be added for diagnostic purposes.
491 */
|
492 kumpf 1.2 class PEGASUS_COMMON_LINKAGE TraceableCIMException : public CIMException
|
493 kumpf 1.1 {
494 public:
495
|
496 kumpf 1.2 TraceableCIMException(
|
497 kumpf 1.21 CIMStatusCode code,
498 const String& message,
499 const String& file,
500 Uint32 line);
501
502 TraceableCIMException(
503 CIMStatusCode code,
|
504 kumpf 1.23 const MessageLoaderParms& parms,
|
505 kumpf 1.21 const String& file,
506 Uint32 line);
507
508 TraceableCIMException(
509 const ContentLanguageList& langs,
510 CIMStatusCode code,
511 const String& message,
512 const String& file,
513 Uint32 line);
|
514 chuck 1.5
|
515 kumpf 1.2 TraceableCIMException(const CIMException & cimException);
516
517 String getDescription() const;
|
518 kumpf 1.1
519 String getTraceDescription() const;
|
520 kumpf 1.11
521 String getCIMMessage() const;
522 void setCIMMessage(const String& cimMessage);
523
524 String getFile() const;
525 Uint32 getLine() const;
|
526 kumpf 1.16 const ContentLanguageList& getContentLanguages() const;
|
527 kumpf 1.2 };
|
528 kumpf 1.1
|
529 kumpf 1.2 #define PEGASUS_CIM_EXCEPTION(CODE, EXTRA_MESSAGE) \
|
530 kumpf 1.11 TraceableCIMException(CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
|
531 chuck 1.5
532 #define PEGASUS_CIM_EXCEPTION_LANG(LANGS, CODE, EXTRA_MESSAGE) \
|
533 kumpf 1.11 TraceableCIMException( \
|
534 kumpf 1.22 LANGS, CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
535
|
536 humberto 1.7 #define PEGASUS_CIM_EXCEPTION_L(CODE, MSG_PARMS) \
|
537 kumpf 1.11 TraceableCIMException(CODE, MSG_PARMS, String(__FILE__), __LINE__)
|
538 kumpf 1.1
|
539 kumpf 1.22 /** Macro to prevent overflow of a signed int value when said value is
|
540 dave.sudlik 1.18 * doubled. If String/Array/Buffer size is greater than 0x3FFFFFFF, then
541 * something is suspect, throw bad_alloc exception.
542 */
543 #define PEGASUS_CHECK_CAPACITY_OVERFLOW(capacity) \
544 do \
545 { \
546 if (capacity > 0x3FFFFFFF) \
547 throw PEGASUS_STD(bad_alloc)(); \
548 } \
549 while (0)
550
|
551 kumpf 1.1 PEGASUS_NAMESPACE_END
552
553 #endif /* Pegasus_InternalException_h */
|