Hazelcast C++ Client
Hazelcast C++ Client Library
Loading...
Searching...
No Matches
hazelcast_sql_exception.h
1/*
2 * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
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#pragma once
17
18#include <boost/uuid/uuid.hpp>
19#include <boost/optional.hpp>
20
21#include "hazelcast/util/export.h"
22#include "hazelcast/client/exception/protocol_exceptions.h"
23
24namespace hazelcast {
25namespace client {
26namespace sql {
27
28class HAZELCAST_API hazelcast_sql_exception : public exception::hazelcast_
29{
30public:
31 hazelcast_sql_exception(std::string source,
32 boost::uuids::uuid originating_member_id,
33 int32_t code,
34 boost::optional<std::string> message,
35 boost::optional<std::string> suggestion,
36 std::exception_ptr cause = nullptr);
37
41 const boost::uuids::uuid& originating_member_id() const;
42
46 int32_t code() const;
47
51 const boost::optional<std::string>& suggestion() const;
52
53private:
54 boost::uuids::uuid originating_member_id_;
55 int32_t code_;
56 boost::optional<std::string> suggestion_;
57};
58
59} // namespace sql
60} // namespace client
61} // namespace hazelcast
int32_t code() const
Gets the internal error code associated with the exception.
Definition sql.cpp:618
const boost::uuids::uuid & originating_member_id() const
Gets ID of the member that caused or initiated an error condition.
Definition sql.cpp:612
const boost::optional< std::string > & suggestion() const
Gets the suggested SQL statement to remediate experienced error.
Definition sql.cpp:624