Loading...
Searching...
No Matches
server_error.hpp
Go to the documentation of this file.
// Copyright 2009-present MongoDB, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <mongocxx/v1/server_error-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/detail/prelude.hpp>
#include <bsoncxx/v1/document/view-fwd.hpp>
#include <bsoncxx/v1/detail/macros.hpp>
#include <mongocxx/v1/config/export.hpp>
#include <mongocxx/v1/exception.hpp> // IWYU pragma: export
#include <memory>
#include <system_error>
namespace mongocxx {
namespace v1 {
BSONCXX_PRIVATE_WARNINGS_PUSH();
BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4251));
BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4275));
class server_error : public v1::exception {
private:
class impl;
std::shared_ptr<impl> _impl;
public:
std::error_code MONGOCXX_ABI_CDECL client_code() const;
bsoncxx::v1::document::view MONGOCXX_ABI_CDECL raw() const;
class internal;
private:
MONGOCXX_ABI_NO_EXPORT /* explicit(false) */
server_error(int code, char const* message, std::unique_ptr<impl> impl);
MONGOCXX_ABI_NO_EXPORT void key_function() const override;
};
BSONCXX_PRIVATE_WARNINGS_POP();
} // namespace v1
} // namespace mongocxx
#include <mongocxx/v1/detail/postlude.hpp>
macros.hpp
For internal use only!
bsoncxx::v1::document::view
A non-owning, read-only BSON document.
Definition view.hpp:52
mongocxx::v1::exception
Base class for all exceptions thrown by mongocxx::v1.
Definition exception.hpp:89
mongocxx::v1::server_error::raw
bsoncxx::v1::document::view raw() const
The raw server error.
mongocxx::v1::server_error::client_code
std::error_code client_code() const
The client error code.
export.hpp
Provides macros to control the set of symbols exported in the ABI.
MONGOCXX_ABI_CDECL
#define MONGOCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition export.hpp:49
MONGOCXX_ABI_NO_EXPORT
#define MONGOCXX_ABI_NO_EXPORT
Excludes the associated entity from being part of the ABI.
Definition export.hpp:20
postlude.hpp
The mongocxx v1 macro guard postlude header.
prelude.hpp
The mongocxx v1 macro guard prelude header.
exception.hpp
Provides mongocxx error-handling utilities.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
server_error-fwd.hpp
Declares mongocxx::v1::server_error.
view-fwd.hpp
Declares bsoncxx::v1::document::view.