JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
jsonv::no_serializer Class Reference

Thrown when formats::serialize does not have a serializer for the type it was asked to serialize. More...

#include <jsonv/serialization/formats.hpp>

+ Inheritance diagram for jsonv::no_serializer:
+ Collaboration diagram for jsonv::no_serializer:

Public Member Functions

 no_serializer (const std::type_info &type, jsonv::path path=jsonv::path())
 Create a new exception for the missing type, wanted at path.
 
 no_serializer (const std::type_index &type, jsonv::path path=jsonv::path())
 Create a new exception for the missing type, wanted at path.
 
- Public Member Functions inherited from jsonv::serialization_error
 serialization_error (jsonv::path path, const std::type_info &type, std::string message, std::exception_ptr cause=nullptr)
 Create a new exception for a failure at path while serializing type, described by message and, if an exception caused it, carrying that exception as cause.
 
 serialization_error (jsonv::path path, const std::type_index &type, std::string message, std::exception_ptr cause=nullptr)
 As above, naming the type by its std::type_index.
 
const jsonv::path & path () const noexcept
 The path of the slot the failing serializer was writing into.
 
std::type_index type_index () const noexcept
 Get an ID for the type which was being serialized.
 
std::string_view type_name () const noexcept
 The demangled name of the type which was being serialized.
 
const std::string & message () const noexcept
 Human-readable details about what went wrong, without the position what prefixes them with.
 
const std::exception_ptr & nested_ptr () const noexcept
 The exception which caused this one, if there was one: what the serializer threw.
 

Detailed Description

Thrown when formats::serialize does not have a serializer for the type it was asked to serialize.

Its serialization_error::path is where in the document the value was wanted. It is empty when the exception came from a lookup which was not writing anything, such as formats::get_serializer.

Definition at line 92 of file formats.hpp.


The documentation for this class was generated from the following file: