ScaleOut C++ Native Client API  5.1
 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 
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
113 // Exception that is thrown when memory cannot be allocated for the PMI worker
115 // Exception that is thrown when memory cannot be allocated for the PMI invoker
117 // Exception that is thrown when a handle to the service could not be opened
119 // Exception that is thrown when a function ID is already registered
121 // Exception that is thrown when a PMI function is called outside of a callback function
123 
128 void throw_soss_exception(int error_code);
129 
130 } } // namespaces