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

Description of a single problem with deserialization. More...

#include <jsonv/serialization/deserialize.hpp>

Public Member Functions

 problem (jsonv::path path, std::exception_ptr cause) noexcept
 Create a problem with a message extracted from cause.
 
const jsonv::path & path () const noexcept
 The path this problem was encountered at, within the document source_name names.
 
const std::string & source_name () const noexcept
 The name of the document this problem was encountered in, such as the file it was read from.
 
const std::string & message () const noexcept
 Human-readable details about the encountered problem.
 
const std::exception_ptr & nested_ptr () const noexcept
 If there was an exception that caused this problem, extra details can be found in the nested exception.
 
 problem (jsonv::path path, std::string message, std::exception_ptr cause) noexcept
 Create a problem for the given path, message, and optional cause.
 
 problem (jsonv::path path, std::string message) noexcept
 Create a problem for the given path, message, and optional cause.
 

Friends

class deserialization_context
 Names the source of a problem recorded on it.
 

Detailed Description

Description of a single problem with deserialization.

Definition at line 137 of file deserialize.hpp.

Constructor & Destructor Documentation

◆ problem()

jsonv::deserialization_error::problem::problem ( jsonv::path  path,
std::exception_ptr  cause 
)
explicitnoexcept

Create a problem with a message extracted from cause.

Parameters
causeThe underlying cause of this problem to extract the message from. If the exception backing cause is not derived from std::exception, a message about unknown exception will be used instead.

Member Function Documentation

◆ message()

const std::string & jsonv::deserialization_error::problem::message ( ) const
inlinenoexcept

Human-readable details about the encountered problem.

Definition at line 172 of file deserialize.hpp.

◆ nested_ptr()

const std::exception_ptr & jsonv::deserialization_error::problem::nested_ptr ( ) const
inlinenoexcept

If there was an exception that caused this problem, extra details can be found in the nested exception.

This can be nullptr if there was no underlying cause.

Definition at line 180 of file deserialize.hpp.

◆ path()

const jsonv::path & jsonv::deserialization_error::problem::path ( ) const
inlinenoexcept

The path this problem was encountered at, within the document source_name names.

Definition at line 156 of file deserialize.hpp.

◆ source_name()

const std::string & jsonv::deserialization_error::problem::source_name ( ) const
inlinenoexcept

The name of the document this problem was encountered in, such as the file it was read from.

This is empty unless the problem was recorded on a deserialization_context which was given one, which is where it comes from – see deserialization_context::source_name.

Definition at line 165 of file deserialize.hpp.

Friends And Related Symbol Documentation

◆ deserialization_context

friend class deserialization_context
friend

Names the source of a problem recorded on it.

Definition at line 187 of file deserialize.hpp.


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