Loading...
Searching...
No Matches
server_error_code.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 <cstdint>
#include <system_error>
#include <mongocxx/exception/server_error_code-fwd.hpp> // IWYU pragma: export
#include <mongocxx/config/prelude.hpp>
namespace mongocxx {
namespace v_noabi {
enum class server_error_code : std::int32_t {
// Intentionally empty at this time!
};
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(std::error_category const&) server_error_category();
inline std::error_code make_error_code(server_error_code error) {
return {static_cast<int>(error), server_error_category()};
}
} // namespace v_noabi
} // namespace mongocxx
namespace mongocxx {
using v_noabi::make_error_code;
using v_noabi::server_error_category;
} // namespace mongocxx
#include <mongocxx/config/postlude.hpp>
namespace std {
// @cond DOXYGEN_DISABLE
template <>
struct is_error_code_enum<mongocxx::v_noabi::server_error_code> : std::true_type {};
// @endcond
} // namespace std
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE
#define MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(...)
Equivalent to MONGOCXX_ABI_EXPORT_UNSTABLE with MONGOCXX_ABI_CDECL.
Definition config.hpp:28
postlude.hpp
The mongocxx v_noabi macro guard postlude header.
prelude.hpp
The mongocxx v_noabi macro guard prelude header.
mongocxx::v1::source_errc::mongocxx
@ mongocxx
From the mongocxx library.
Definition exception.hpp:40
mongocxx::v_noabi
Declares entities whose ABI stability is NOT guaranteed.
mongocxx::v_noabi::make_error_code
std::error_code make_error_code(error_code error)
Translate a mongocxx::v_noabi::error_code into a std::error_code.
Definition error_code.hpp:133
mongocxx::v_noabi::server_error_category
std::error_category const & server_error_category()
Get the error_category for mongocxx library exceptions.
mongocxx::v_noabi::server_error_code
server_error_code
Errors which may be returned by the server.
Definition server_error_code.hpp:35
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
server_error_code-fwd.hpp
Declares mongocxx::v_noabi::server_error_code.