BLPAPI C++  3.21.0
blpapi_error.h
Go to the documentation of this file.
1 /* Copyright 2012. Bloomberg Finance L.P.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions: The above
9  * copyright notice and this permission notice shall be included in all copies
10  * or substantial portions of the Software.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
18  * IN THE SOFTWARE.
19  */
20 
28 #ifndef INCLUDED_BLPAPI_ERROR
29 #define INCLUDED_BLPAPI_ERROR
30 
49 #ifndef INCLUDED_BLPAPI_DEFS
50 #include <blpapi_defs.h>
51 #endif
52 
53 #define BLPAPI_RESULTCODE(res) ((res)&0xffff)
54 #define BLPAPI_RESULTCLASS(res) ((res)&0xff0000)
55 
56 #define BLPAPI_UNKNOWN_CLASS 0x00000
57 #define BLPAPI_INVALIDSTATE_CLASS 0x10000
58 #define BLPAPI_INVALIDARG_CLASS 0x20000
59 #define BLPAPI_IOERROR_CLASS 0x30000
60 #define BLPAPI_CNVERROR_CLASS 0x40000
61 #define BLPAPI_BOUNDSERROR_CLASS 0x50000
62 #define BLPAPI_NOTFOUND_CLASS 0x60000
63 #define BLPAPI_FLDNOTFOUND_CLASS 0x70000
64 #define BLPAPI_UNSUPPORTED_CLASS 0x80000
65 
66 #define BLPAPI_ERROR_UNKNOWN (BLPAPI_UNKNOWN_CLASS | 1)
67 #define BLPAPI_ERROR_ILLEGAL_ARG (BLPAPI_INVALIDARG_CLASS | 2)
68 #define BLPAPI_ERROR_ILLEGAL_ACCESS (BLPAPI_UNSUPPORTED_CLASS | 3)
69 #define BLPAPI_ERROR_INVALID_SESSION (BLPAPI_INVALIDARG_CLASS | 4)
70 #define BLPAPI_ERROR_DUPLICATE_CORRELATIONID (BLPAPI_INVALIDARG_CLASS | 5)
71 #define BLPAPI_ERROR_INTERNAL_ERROR (BLPAPI_UNKNOWN_CLASS | 6)
72 #define BLPAPI_ERROR_RESOLVE_FAILED (BLPAPI_IOERROR_CLASS | 7)
73 #define BLPAPI_ERROR_CONNECT_FAILED (BLPAPI_IOERROR_CLASS | 8)
74 #define BLPAPI_ERROR_ILLEGAL_STATE (BLPAPI_INVALIDSTATE_CLASS | 9)
75 #define BLPAPI_ERROR_CODEC_FAILURE (BLPAPI_UNKNOWN_CLASS | 10)
76 #define BLPAPI_ERROR_INDEX_OUT_OF_RANGE (BLPAPI_BOUNDSERROR_CLASS | 11)
77 #define BLPAPI_ERROR_INVALID_CONVERSION (BLPAPI_CNVERROR_CLASS | 12)
78 #define BLPAPI_ERROR_ITEM_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 13)
79 #define BLPAPI_ERROR_IO_ERROR (BLPAPI_IOERROR_CLASS | 14)
80 #define BLPAPI_ERROR_CORRELATION_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 15)
81 #define BLPAPI_ERROR_SERVICE_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 16)
82 #define BLPAPI_ERROR_LOGON_LOOKUP_FAILED (BLPAPI_UNKNOWN_CLASS | 17)
83 #define BLPAPI_ERROR_DS_LOOKUP_FAILED (BLPAPI_UNKNOWN_CLASS | 18)
84 #define BLPAPI_ERROR_UNSUPPORTED_OPERATION (BLPAPI_UNSUPPORTED_CLASS | 19)
85 #define BLPAPI_ERROR_DS_PROPERTY_NOT_FOUND (BLPAPI_NOTFOUND_CLASS | 20)
86 #define BLPAPI_ERROR_MSG_TOO_LARGE (BLPAPI_INVALIDARG_CLASS | 21)
87 
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 
93 const char *blpapi_getLastErrorDescription(int resultCode);
94 
95 #ifdef __cplusplus
96 }
97 
105 namespace BloombergLP {
106 namespace blpapi {
107 
108 } // close namespace blpapi
109 } // close namespace BloombergLP
110 
114 #endif
115 
116 #endif // #ifndef INCLUDED_BLPAPI_ERROR
Common definitions used by the library.
Definition: blpapi_abstractsession.h:215
const char * blpapi_getLastErrorDescription(int resultCode)
#define BLPAPI_EXPORT
Definition: blpapi_defs.h:171