11#include <userver/formats/yaml/types.hpp>
13USERVER_NAMESPACE_BEGIN
19 explicit Exception(std::string msg)
20 : msg_(std::move(msg))
23 const char* what()
const noexcept final {
return msg_.c_str(); }
25 std::string_view GetMessage()
const noexcept {
return msg_; }
38 explicit ExceptionWithPath(std::string_view msg, std::string_view path);
40 std::string_view GetPath()
const noexcept;
41 std::string_view GetMessageWithoutPath()
const noexcept;
44 std::size_t path_size_;
49 explicit BadStreamException(
const std::istream& is);
50 explicit BadStreamException(
const std::ostream& os);
55 TypeMismatchException(
Type actual,
Type expected, std::string_view path);
56 TypeMismatchException(
int actual,
int expected, std::string_view path);
57 TypeMismatchException(
const YAML::Node& value, std::string_view expected_type, std::string_view path);
62 OutOfBoundsException(size_t index, size_t size, std::string_view path);
67 explicit MemberMissingException(std::string_view path);
72 explicit PathPrefixException(std::string_view old_path, std::string_view prefix);