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 // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
33 //
34 kumpf 1.1 // Modified By:
35 //
36 //%/////////////////////////////////////////////////////////////////////////////
37
38 #ifndef Pegasus_InternalException_h
39 #define Pegasus_InternalException_h
40
41 #include <Pegasus/Common/Config.h>
42 #include <Pegasus/Common/Linkage.h>
43 #include <Pegasus/Common/Exception.h>
|
44 jim.wunderlich 1.14 #include <Pegasus/Common/PegasusAssert.h>
45
46
|
47 kumpf 1.1
48 PEGASUS_NAMESPACE_BEGIN
49
50 /** Class AssertionFailureException
51 This is an Exception class tied to the definiton of an assert named
52 PEGASUS_ASSERT. This assertion can be included at any point in Pegasus
53 code
54 */
55 class PEGASUS_COMMON_LINKAGE AssertionFailureException : public Exception
56 {
57 public:
58
59 AssertionFailureException(
60 const char* file,
61 size_t line,
62 const String& message);
|
63 mike 1.19
64 virtual ~AssertionFailureException();
|
65 kumpf 1.1 };
66
67
68 /* Macro to Create the equivalent of an assert but without the
69 termination. This can be used as a temporary marker for asserts
70 that are not working. Prints out the error but continues.
71 NOTE: This is useful in test programs to keep us aware that we
72 have problems without halting the test sequence.
73 This was created primarily to put temporary asserts into tests that
74 are not yet working correctly but will not stop the test sequence.
75 */
76 #define ASSERTTEMP(COND) \
77 do \
78 { \
79 if (!(COND)) \
80 { \
81 cerr << "TEMP Assert Error TEMP **********" \
82 <<__FILE__ << " " << __LINE__ \
83 << " " << #COND << endl; \
84 } \
85 } while (0)
86 kumpf 1.1
87
88 // ATTN: P3 KS documentation Required
89 class PEGASUS_COMMON_LINKAGE NullPointer : public Exception
90 {
91 public:
92
93 static const char MSG[];
|
94 chuck 1.6 static const char KEY[];
|
95 kumpf 1.1
|
96 mike 1.19 NullPointer();
|
97 chuck 1.5
|
98 mike 1.19 virtual ~NullPointer();
|
99 kumpf 1.1 };
100
101 // ATTN: P3 KS documentation Required
102 class PEGASUS_COMMON_LINKAGE UndeclaredQualifier : public Exception
103 {
104 public:
105
106 static const char MSG[];
|
107 chuck 1.6 static const char KEY[];
|
108 kumpf 1.1
|
109 mike 1.19 UndeclaredQualifier(const String& qualifierName) ;
|
110 chuck 1.5
|
111 mike 1.19 virtual ~UndeclaredQualifier();
|
112 kumpf 1.1 };
113
114 // ATTN: P3 KS documentation Required
115 class PEGASUS_COMMON_LINKAGE BadQualifierScope : public Exception
116 {
117 public:
118
|
119 chuck 1.6 static const char MSG[];
120 static const char KEY[];
|
121 kumpf 1.1
|
122 mike 1.19 BadQualifierScope(
123 const String& qualifierName,
124 const String& scopeString);
|
125 chuck 1.5
|
126 mike 1.19 virtual ~BadQualifierScope();
|
127 kumpf 1.1 };
128
129 // ATTN: P3 KS documentation Required
130 class PEGASUS_COMMON_LINKAGE BadQualifierOverride : public Exception
131 {
132 public:
133
134 static const char MSG[];
|
135 chuck 1.6 static const char KEY[];
|
136 kumpf 1.1
|
137 mike 1.19 BadQualifierOverride(const String& qualifierName);
138
139 virtual ~BadQualifierOverride();
|
140 kumpf 1.1 };
141
142 class PEGASUS_COMMON_LINKAGE BadQualifierType : public Exception
143 {
144 public:
145
146 static const char MSG[];
|
147 chuck 1.6 static const char KEY[];
|
148 kumpf 1.1
|
149 mike 1.19 BadQualifierType(const String& qualifierName);
150 virtual ~BadQualifierType();
|
151 kumpf 1.1 };
152
153 // ATTN: P3 KS documentation Required
154 class PEGASUS_COMMON_LINKAGE ClassAlreadyResolved : public Exception
155 {
156 public:
157
158 static const char MSG[];
|
159 chuck 1.6 static const char KEY[];
|
160 kumpf 1.1
|
161 mike 1.19 ClassAlreadyResolved(const String& className);
162
163 virtual ~ClassAlreadyResolved();
|
164 kumpf 1.1 };
165
166 // ATTN: P3 KS documentation Required
167 class PEGASUS_COMMON_LINKAGE ClassNotResolved : public Exception
168 {
169 public:
170
171 static const char MSG[];
|
172 chuck 1.6 static const char KEY[];
|
173 kumpf 1.1
|
174 mike 1.19 ClassNotResolved(const String& className);
175 virtual ~ClassNotResolved();
|
176 kumpf 1.1 };
177
178 // ATTN: P3 KS documentation Required
179 class PEGASUS_COMMON_LINKAGE InstanceAlreadyResolved : public Exception
180 {
181 public:
182
183 static const char MSG[];
|
184 chuck 1.6 static const char KEY[];
|
185 kumpf 1.1
|
186 mike 1.19 InstanceAlreadyResolved();
187 virtual ~InstanceAlreadyResolved();
|
188 kumpf 1.1 };
189
190 // ATTN: P3 KS documentation Required
191 class PEGASUS_COMMON_LINKAGE InstantiatedAbstractClass : public Exception
192 {
193 public:
194
195 static const char MSG[];
|
196 chuck 1.6 static const char KEY[];
|
197 kumpf 1.1
|
198 mike 1.19 InstantiatedAbstractClass(const String& className);
199 virtual ~InstantiatedAbstractClass();
|
200 kumpf 1.1 };
201
202 // ATTN: P3 KS documentation Required
203 class PEGASUS_COMMON_LINKAGE NoSuchProperty : public Exception
204 {
205 public:
206
207 static const char MSG[];
|
208 chuck 1.6 static const char KEY[];
|
209 kumpf 1.1
|
210 mike 1.19 NoSuchProperty(const String& propertyName);
211 virtual ~NoSuchProperty();
|
212 kumpf 1.1 };
213
214 // ATTN: P3 KS documentation Required
215 class PEGASUS_COMMON_LINKAGE NoSuchFile : public Exception
216 {
217 public:
218
219 static const char MSG[];
|
220 chuck 1.6 static const char KEY[];
|
221 kumpf 1.1
|
222 mike 1.19 NoSuchFile(const String& fileName);
223 virtual ~NoSuchFile();
|
224 kumpf 1.1 };
225
226 // ATTN: P3 KS documentation Required
227 class PEGASUS_COMMON_LINKAGE FileNotReadable : public Exception
228 {
229 public:
230
231 static const char MSG[];
|
232 chuck 1.6 static const char KEY[];
|
233 kumpf 1.1
|
234 mike 1.19 FileNotReadable(const String& fileName);
235 virtual ~FileNotReadable();
|
236 kumpf 1.1 };
237
238 // ATTN: P3 KS documentation Required
239 class PEGASUS_COMMON_LINKAGE CannotRemoveDirectory : public Exception
240 {
241 public:
242
243 static const char MSG[];
|
244 chuck 1.6 static const char KEY[];
|
245 kumpf 1.1
|
246 mike 1.19 CannotRemoveDirectory(const String& path);
247 virtual ~CannotRemoveDirectory();
|
248 kumpf 1.1 };
249
250 // ATTN: P3 KS documentation Required
251 class PEGASUS_COMMON_LINKAGE CannotRemoveFile : public Exception
252 {
253 public:
254
255 static const char MSG[];
|
256 chuck 1.6 static const char KEY[];
|
257 kumpf 1.1
|
258 mike 1.19 CannotRemoveFile(const String& path);
259 virtual ~CannotRemoveFile();
|
260 kumpf 1.1 };
261
262 // ATTN: P3 KS documentation Required
263 class PEGASUS_COMMON_LINKAGE CannotRenameFile : public Exception
264 {
265 public:
266
267 static const char MSG[];
|
268 chuck 1.6 static const char KEY[];
|
269 kumpf 1.1
|
270 mike 1.19 CannotRenameFile(const String& path);
271 virtual ~CannotRenameFile();
|
272 kumpf 1.1 };
273
274 // ATTN: P3 KS documentation Required
275 class PEGASUS_COMMON_LINKAGE NoSuchDirectory : public Exception
276 {
277 public:
278
279 static const char MSG[];
|
280 chuck 1.6 static const char KEY[];
|
281 kumpf 1.1
|
282 mike 1.19 NoSuchDirectory(const String& directoryName);
283 virtual ~NoSuchDirectory();
|
284 kumpf 1.1 };
285
286 // ATTN: P3 KS documentation Required
287 class PEGASUS_COMMON_LINKAGE CannotCreateDirectory : public Exception
288 {
289 public:
290
291 static const char MSG[];
|
292 chuck 1.6 static const char KEY[];
|
293 kumpf 1.1
|
294 mike 1.19 CannotCreateDirectory(const String& path);
295 virtual ~CannotCreateDirectory();
|
296 kumpf 1.1 };
297
298 // ATTN: P3 KS documentation Required
299 class PEGASUS_COMMON_LINKAGE CannotOpenFile : public Exception
300 {
301 public:
302
303 static const char MSG[];
|
304 chuck 1.6 static const char KEY[];
|
305 kumpf 1.1
|
306 mike 1.19 CannotOpenFile(const String& path);
307 virtual ~CannotOpenFile();
|
308 kumpf 1.1 };
309
310 // ATTN: P3 KS documentation Required
311 class PEGASUS_COMMON_LINKAGE NotImplemented : public Exception
312 {
313 public:
314
315 static const char MSG[];
|
316 chuck 1.6 static const char KEY[];
|
317 kumpf 1.1
|
318 mike 1.19 NotImplemented(const String& method);
319 virtual ~NotImplemented();
|
320 kumpf 1.1 };
321
322 class PEGASUS_COMMON_LINKAGE StackUnderflow : public Exception
323 {
324 public:
325
326 static const char MSG[];
|
327 chuck 1.6 static const char KEY[];
|
328 kumpf 1.1
|
329 mike 1.19 StackUnderflow();
330 virtual ~StackUnderflow();
|
331 kumpf 1.1 };
332
333 class PEGASUS_COMMON_LINKAGE StackOverflow : public Exception
334 {
335 public:
336
337 static const char MSG[];
|
338 chuck 1.6 static const char KEY[];
|
339 kumpf 1.1
|
340 mike 1.19 StackOverflow();
341 virtual ~StackOverflow();
|
342 kumpf 1.1 };
343
344 class PEGASUS_COMMON_LINKAGE QueueUnderflow : public Exception
345 {
346 public:
347
348 static const char MSG[];
|
349 chuck 1.6 static const char KEY[];
|
350 kumpf 1.1
|
351 mike 1.19 QueueUnderflow();
352 virtual ~QueueUnderflow();
|
353 kumpf 1.1 };
354
355 class PEGASUS_COMMON_LINKAGE BadFormat : public Exception
356 {
357 public:
358
359 static const char MSG[];
|
360 chuck 1.6 static const char KEY[];
|
361 kumpf 1.1
|
362 mike 1.19 BadFormat();
363 virtual ~BadFormat();
|
364 kumpf 1.1 };
365
366 class PEGASUS_COMMON_LINKAGE BadlyFormedCGIQueryString : public Exception
367 {
368 public:
369
370 static const char MSG[];
|
371 chuck 1.6 static const char KEY[];
|
372 kumpf 1.1
|
373 mike 1.19 BadlyFormedCGIQueryString();
374 virtual ~BadlyFormedCGIQueryString();
|
375 kumpf 1.1 };
376
377 class PEGASUS_COMMON_LINKAGE DynamicLoadFailed : public Exception
378 {
379 public:
380
381 static const char MSG[];
|
382 chuck 1.6 static const char KEY[];
|
383 kumpf 1.1
|
384 mike 1.19 DynamicLoadFailed(const String& libraryName);
385 virtual ~DynamicLoadFailed();
|
386 kumpf 1.1 };
387
388 class PEGASUS_COMMON_LINKAGE DynamicLookupFailed : public Exception
389 {
390 public:
391
392 static const char MSG[];
|
393 chuck 1.6 static const char KEY[];
|
394 kumpf 1.1
|
395 mike 1.19 DynamicLookupFailed(const String& symbolName);
396 virtual ~DynamicLookupFailed();
|
397 kumpf 1.1 };
398
399 class PEGASUS_COMMON_LINKAGE CannotOpenDirectory : public Exception
400 {
401 public:
402
403 static const char MSG[];
|
404 chuck 1.6 static const char KEY[];
|
405 kumpf 1.1
|
406 mike 1.19 CannotOpenDirectory(const String& path);
407 virtual ~CannotOpenDirectory();
|
408 kumpf 1.1 };
409
410 class PEGASUS_COMMON_LINKAGE ParseError : public Exception
411 {
412 public:
413
414 static const char MSG[];
|
415 chuck 1.6 static const char KEY[];
|
416 kumpf 1.1
|
417 mike 1.19 ParseError(const String& message);
418 virtual ~ParseError();
|
419 kumpf 1.1 };
420
421 class PEGASUS_COMMON_LINKAGE MissingNullTerminator : public Exception
422 {
423 public:
424
425 static const char MSG[];
|
426 chuck 1.6 static const char KEY[];
|
427 kumpf 1.1
|
428 mike 1.19 MissingNullTerminator();
429 virtual ~MissingNullTerminator();
|
430 chuck 1.5 };
431
432 //l10n start
433
434 class PEGASUS_COMMON_LINKAGE MalformedLanguageHeader: public Exception
435 {
436 public:
437
438 static const char MSG[];
|
439 chuck 1.6 static const char KEY[];
|
440 chuck 1.5
|
441 mike 1.19 MalformedLanguageHeader(const String& error);
442 virtual ~MalformedLanguageHeader();
|
443 chuck 1.5 };
444
445 class PEGASUS_COMMON_LINKAGE InvalidAcceptLanguageHeader: public Exception
446 {
447 public:
448
449 static const char MSG[];
|
450 chuck 1.6 static const char KEY[];
|
451 chuck 1.5
|
452 mike 1.19 InvalidAcceptLanguageHeader(const String& error);
453 virtual ~InvalidAcceptLanguageHeader();
|
454 kumpf 1.1 };
455
|
456 chuck 1.5 class PEGASUS_COMMON_LINKAGE InvalidContentLanguageHeader: public Exception
457 {
458 public:
459
460 static const char MSG[];
|
461 chuck 1.6 static const char KEY[];
|
462 chuck 1.5
|
463 mike 1.19 InvalidContentLanguageHeader(const String& error);
464 virtual ~InvalidContentLanguageHeader();
|
465 chuck 1.5 };
466
467 //l10n end
468
|
469 kumpf 1.1 class PEGASUS_COMMON_LINKAGE InvalidAuthHeader: public Exception
470 {
471 public:
472
473 static const char MSG[];
|
474 chuck 1.6 static const char KEY[];
|
475 kumpf 1.1
|
476 mike 1.19 InvalidAuthHeader();
477 virtual ~InvalidAuthHeader();
|
478 kumpf 1.1 };
479
480 class PEGASUS_COMMON_LINKAGE UnauthorizedAccess: public Exception
481 {
482 public:
483
484 static const char MSG[];
|
485 chuck 1.6 static const char KEY[];
|
486 kumpf 1.1
|
487 mike 1.19 UnauthorizedAccess();
488 virtual ~UnauthorizedAccess();
|
489 kumpf 1.1 };
490
|
491 kumpf 1.4 class PEGASUS_COMMON_LINKAGE IncompatibleTypesException : public Exception
492 {
493 public:
|
494 chuck 1.5 IncompatibleTypesException();
|
495 mike 1.19 virtual ~IncompatibleTypesException();
|
496 kumpf 1.4 };
497
|
498 kumpf 1.10 class PEGASUS_COMMON_LINKAGE InternalSystemError : public Exception
499 {
500 public:
501
502 static const char MSG[];
503
|
504 mike 1.19 InternalSystemError();
505 virtual ~InternalSystemError();
|
506 kumpf 1.10 };
507
|
508 kumpf 1.4
|
509 kumpf 1.1 /** The CIMException defines the CIM exceptions that are formally defined in
|
510 kumpf 1.2 the CIM Operations over HTTP specification. TraceableCIMException allows
|
511 kumpf 1.1 file name and line number information to be added for diagnostic purposes.
512 */
|
513 kumpf 1.2 class PEGASUS_COMMON_LINKAGE TraceableCIMException : public CIMException
|
514 kumpf 1.1 {
515 public:
516
|
517 kumpf 1.2 TraceableCIMException(
518 CIMStatusCode code,
519 const String& message,
|
520 kumpf 1.11 const String& file,
|
521 kumpf 1.2 Uint32 line);
|
522 humberto 1.7
523 //l10n
524 TraceableCIMException(
525 CIMStatusCode code,
526 MessageLoaderParms parms,
|
527 kumpf 1.11 const String& file,
|
528 humberto 1.7 Uint32 line);
|
529 kumpf 1.2
|
530 chuck 1.5 // l10n
531 TraceableCIMException(
|
532 kumpf 1.16 const ContentLanguageList& langs,
|
533 chuck 1.5 CIMStatusCode code,
534 const String& message,
|
535 kumpf 1.11 const String& file,
|
536 chuck 1.5 Uint32 line);
537
|
538 kumpf 1.2 TraceableCIMException(const CIMException & cimException);
539
540 String getDescription() const;
|
541 kumpf 1.1
542 String getTraceDescription() const;
|
543 kumpf 1.11
544 String getCIMMessage() const;
545 void setCIMMessage(const String& cimMessage);
546
547 String getFile() const;
548 Uint32 getLine() const;
|
549 kumpf 1.16 const ContentLanguageList& getContentLanguages() const;
|
550 kumpf 1.2 };
|
551 kumpf 1.1
|
552 kumpf 1.2 #define PEGASUS_CIM_EXCEPTION(CODE, EXTRA_MESSAGE) \
|
553 kumpf 1.11 TraceableCIMException(CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
|
554 chuck 1.5
555 // l10n
556 #define PEGASUS_CIM_EXCEPTION_LANG(LANGS, CODE, EXTRA_MESSAGE) \
|
557 kumpf 1.11 TraceableCIMException( \
558 LANGS, CODE, EXTRA_MESSAGE, String(__FILE__), __LINE__)
|
559 humberto 1.7
560 //l10n
561 #define PEGASUS_CIM_EXCEPTION_L(CODE, MSG_PARMS) \
|
562 kumpf 1.11 TraceableCIMException(CODE, MSG_PARMS, String(__FILE__), __LINE__)
|
563 kumpf 1.1
|
564 dave.sudlik 1.18 /** Macro to prevent overflow of a signed int value when said value is
565 * doubled. If String/Array/Buffer size is greater than 0x3FFFFFFF, then
566 * something is suspect, throw bad_alloc exception.
567 */
568 #define PEGASUS_CHECK_CAPACITY_OVERFLOW(capacity) \
569 do \
570 { \
571 if (capacity > 0x3FFFFFFF) \
572 throw PEGASUS_STD(bad_alloc)(); \
573 } \
574 while (0)
575
|
576 kumpf 1.1 PEGASUS_NAMESPACE_END
577
578 #endif /* Pegasus_InternalException_h */
|