1 mike 1.22 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 kumpf 1.42 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
|
5 mike 1.22 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 chip 1.39 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
10 mike 1.22 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
|
12 kumpf 1.42 //
|
13 chip 1.39 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
14 mike 1.22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
16 chip 1.39 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
19 mike 1.22 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 //==============================================================================
23 //
24 // Author: Mike Brasher (mbrasher@bmc.com)
25 //
|
26 kumpf 1.52 // Modified By: Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)
27 // Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com)
|
28 kumpf 1.43 // Carol Ann Krug Graves, Hewlett-Packard Company
29 // (carolann_graves@hp.com)
|
30 kumpf 1.52 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
31 mike 1.22 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #include <cstdio>
35 #include "Exception.h"
|
36 kumpf 1.53 #include <Pegasus/Common/CIMExceptionRep.h>
|
37 kumpf 1.33 #include "Tracer.h"
|
38 mike 1.22
39 PEGASUS_NAMESPACE_BEGIN
40
|
41 chip 1.39 Exception::Exception(const String& message) : _message(message)
42 {
|
43 mike 1.22 }
44
|
45 chip 1.39 Exception::Exception(const char* message) : _message(message)
|
46 mike 1.22 {
47 }
48
49 Exception::~Exception()
50 {
51 }
52
53
54 const char OutOfBounds::MSG[] = "out of bounds";
55
56 const char AlreadyExists::MSG[] = "already exists: ";
57
58 const char IllegalName::MSG[] = "illegal CIM name";
59
|
60 kumpf 1.44 const char IllegalNamespaceName::MSG[] = "illegal CIM namespace name";
61
|
62 kumpf 1.52 const char UninitializedHandle::MSG[] = "uninitialized handle";
|
63 mike 1.22
|
64 kumpf 1.52 const char UninitializedObject::MSG[] = "uninitialized object";
|
65 mike 1.22
|
66 chip 1.39 const char AddedReferenceToClass::MSG[] =
|
67 mike 1.22 "attempted to add reference to a non-association class: ";
68
|
69 chip 1.39 const char TruncatedCharacter::MSG[] =
|
70 mike 1.22 "truncated character during conversion from Char16 to char";
71
|
72 chip 1.39 const char ExpectedReferenceValue::MSG[] =
|
73 kumpf 1.43 "Expected CIMValue object to be of type reference "
|
74 mike 1.22 "in this context";
75
76 const char MissingReferenceClassName::MSG[] = "missing reference class name";
77
78 const char TypeMismatch::MSG[] = "type mismatch";
79
|
80 karl 1.25 const char CIMValueInvalidType::MSG[] = "invalid CIMValue type";
81
|
82 mike 1.24 const char DynamicCastFailed::MSG[] = "dynamic cast failed";
83
|
84 mike 1.22 const char BadDateTimeFormat::MSG[] = "bad datetime format";
85
86 const char IncompatibleTypes::MSG[] = "incompatible types";
87
88 const char IllformedObjectName::MSG[] = "illformed object name: ";
89
|
90 kumpf 1.52 const char BindFailedException::MSG[] = "Bind failed: ";
|
91 mike 1.23
|
92 kumpf 1.52 const char InvalidLocatorException::MSG[] = "Invalid locator: ";
|
93 mike 1.23
|
94 kumpf 1.52 const char CannotCreateSocketException::MSG[] = "Cannot create socket";
|
95 mike 1.23
|
96 kumpf 1.52 const char CannotConnectException::MSG[] = "Cannot connect to: ";
|
97 mike 1.23
|
98 kumpf 1.52 const char UnexpectedFailureException::MSG[] = "Unexpected failure";
|
99 mike 1.23
|
100 kumpf 1.52 const char AlreadyConnectedException::MSG[] = "already connected";
|
101 mike 1.23
|
102 kumpf 1.52 const char NotConnectedException::MSG[] = "not connected";
|
103 mike 1.22
|
104 kumpf 1.52 const char ConnectionTimeoutException::MSG[] = "connection timed out";
|
105 kumpf 1.26
|
106 kumpf 1.52 const char SSLException::MSG[] = "SSL Exception ";
|
107 kumpf 1.40
|
108 kumpf 1.26
|
109 mike 1.22 ////////////////////////////////////////////////////////////////////////////////
110 //
111 // CIMException
112 //
113 ////////////////////////////////////////////////////////////////////////////////
114
|
115 kumpf 1.53 CIMException::CIMException(
|
116 kumpf 1.29 CIMStatusCode code,
|
117 kumpf 1.37 const String& message)
|
118 kumpf 1.53 :
119 Exception(message)
|
120 kumpf 1.29 {
|
121 kumpf 1.53 _rep = new CIMExceptionRep();
122 _rep->code = code;
123 _rep->file = "";
124 _rep->line = 0;
|
125 kumpf 1.29 }
126
|
127 kumpf 1.53 CIMException::CIMException(const CIMException & cimException)
128 : Exception(cimException.getMessage())
129 {
130 _rep = new CIMExceptionRep();
131 _rep->code = cimException._rep->code;
132 _rep->file = cimException._rep->file;
133 _rep->line = cimException._rep->line;
|
134 mike 1.22 }
135
|
136 kumpf 1.53 CIMException& CIMException::operator=(const CIMException & cimException)
|
137 mike 1.22 {
|
138 kumpf 1.53 _message = cimException._message;
139 _rep->code = cimException._rep->code;
140 _rep->file = cimException._rep->file;
141 _rep->line = cimException._rep->line;
142 return *this;
|
143 kumpf 1.32 }
144
|
145 kumpf 1.53 CIMException::~CIMException()
|
146 kumpf 1.37 {
|
147 kumpf 1.53 delete _rep;
|
148 kumpf 1.37 }
149
|
150 kumpf 1.53 CIMStatusCode CIMException::getCode() const
|
151 kumpf 1.37 {
|
152 kumpf 1.53 return _rep->code;
|
153 mike 1.22 }
154
155 PEGASUS_NAMESPACE_END
|