11#include <userver/formats/yaml/types.hpp>
13USERVER_NAMESPACE_BEGIN
15namespace formats::
yaml {
19 explicit Exception(std::string msg) : msg_(std::move(msg)) {}
21 const char* what()
const noexcept final {
return msg_.c_str(); }
23 std::string_view GetMessage()
const noexcept {
return msg_; }
36 explicit ExceptionWithPath(std::string_view msg, std::string_view path);
38 std::string_view GetPath()
const noexcept;
39 std::string_view GetMessageWithoutPath()
const noexcept;
42 std::size_t path_size_;
47 explicit BadStreamException(
const std::istream& is);
48 explicit BadStreamException(
const std::ostream& os);
53 TypeMismatchException(
Type actual,
Type expected, std::string_view path);
54 TypeMismatchException(
int actual,
int expected, std::string_view path);
55 TypeMismatchException(
const YAML::Node& value, std::string_view expected_type,
56 std::string_view path);
61 OutOfBoundsException(size_t index, size_t size, std::string_view path);
66 explicit MemberMissingException(std::string_view path);
71 explicit PathPrefixException(std::string_view old_path,
72 std::string_view prefix);