ScaleOut C++ Native Client API
5.1
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
exceptions.h
1
/*
2
Copyright (c) 2013 by ScaleOut Software, Inc.
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
17
#pragma once
18
19
#include <string>
20
#include <stdexcept>
21
#include <vector>
22
#include "boost/exception/all.hpp"
23
24
25
namespace
sosscli {
namespace
exceptions {
26
27
/* Tags for additional data values that may be optionally stored in exceptions thrown to the caller */
28
/* See http://www.boost.org/doc/libs/1_54_0/libs/exception/doc/tutorial_transporting_data.html
29
for details on transporting arbitrary data to catch site. */
30
32
typedef
boost::error_info<struct tag_soss_err_code, int> soss_err_code;
34
typedef
boost::error_info<struct tag_soss_err_key, std::string> soss_err_key;
36
typedef
boost::error_info<struct tag_soss_err_op, std::string> soss_err_operation;
38
typedef
boost::error_info<struct tag_soss_err_msg, std::string> soss_err_msg;
39
40
42
struct
StateServerException
:
virtual
std::exception,
virtual
boost::exception
43
{
46
virtual
const
char
*
what
()
const
throw
();
47
};
48
49
50
/* Exceptions mapped to error codes specified in soss_svcli.h */
51
53
struct
CantInitException
:
virtual
StateServerException
{ };
55
struct
BadHandleException
:
virtual
StateServerException
{ };
57
struct
HandleBusyException
:
virtual
StateServerException
{ };
59
struct
CantConnectException
:
virtual
StateServerException
{ };
61
struct
BadKeyException
:
virtual
StateServerException
{ };
63
struct
BadArgsException
:
virtual
StateServerException
{ };
65
struct
CantAccessException
:
virtual
StateServerException
{ };
67
struct
ObjectExistsException
:
virtual
StateServerException
{ };
69
struct
ObjectNotFoundException
:
virtual
StateServerException
{ };
71
struct
NotReadingException
:
virtual
StateServerException
{ };
73
struct
AppNameInUseException
:
virtual
StateServerException
{ };
75
struct
ObjectLockedException
:
virtual
StateServerException
{ };
77
struct
LowMemoryException
:
virtual
StateServerException
{ };
79
struct
OperationFailedException
:
virtual
StateServerException
{ };
81
struct
NotLicensedException
:
virtual
StateServerException
{ };
83
struct
NotReadyException
:
virtual
StateServerException
{ };
85
struct
TimeoutException
:
virtual
StateServerException
{ };
87
struct
ObjectReadingException
:
virtual
StateServerException
{ };
89
struct
VersionMismatchException
:
virtual
StateServerException
{ };
91
struct
BadPropertiesException
:
virtual
StateServerException
{ };
93
struct
AuthorizationNotNeededException
:
virtual
StateServerException
{ };
95
struct
MultipleLoginException
:
virtual
StateServerException
{ };
97
struct
NotAuthorizedException
:
virtual
StateServerException
{ };
99
struct
CantAccessRemoteStoreException
:
virtual
StateServerException
{ };
101
struct
NoActiveRemoteStoresException
:
virtual
StateServerException
{ };
103
struct
LocalNameNotSetException
:
virtual
StateServerException
{ };
105
struct
ProxyFoundException
:
virtual
StateServerException
{ };
107
struct
NotImplementedException
:
virtual
StateServerException
{ };
108
109
/* Exceptions mapped to error codes specified in soss_pmicli.h */
110
111
// Exception that is thrown when the PMI worker cannot be initialized
112
struct
CantInitWorkerException
:
virtual
StateServerException
{ };
113
// Exception that is thrown when memory cannot be allocated for the PMI worker
114
struct
LowWorkerMemoryException
:
virtual
StateServerException
{ };
115
// Exception that is thrown when memory cannot be allocated for the PMI invoker
116
struct
LowInvokerMemoryException
:
virtual
StateServerException
{ };
117
// Exception that is thrown when a handle to the service could not be opened
118
struct
CantOpenHandleException
:
virtual
StateServerException
{ };
119
// Exception that is thrown when a function ID is already registered
120
struct
FuncIdAlreadyRegisteredException
:
virtual
StateServerException
{ };
121
// Exception that is thrown when a PMI function is called outside of a callback function
122
struct
NotInCallbackException
:
virtual
StateServerException
{ };
123
128
void
throw_soss_exception(
int
error_code);
129
130
} }
// namespaces
© 2014
ScaleOut Software, Inc.