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

Exception thrown if there is any problem running extract. More...

#include <jsonv/serialization.hpp>

+ Inheritance diagram for jsonv::extraction_error:
+ Collaboration diagram for jsonv::extraction_error:

Classes

class  problem
 Description of a single problem with extraction. More...
 

Public Types

using problem_list = std::vector< problem >
 

Public Member Functions

 extraction_error (problem_list problems) noexcept
 Create an extraction_error from the given list of problems.
 
const jsonv::pathpath () const noexcept
 Get the path the first extraction error came from.
 
const std::exception_ptr & nested_ptr () const noexcept
 Get the first problem::cause.
 
const problem_list & problems () const noexcept
 Get the list of problems which caused this extraction_error.
 
 extraction_error (jsonv::path path, std::string message, std::exception_ptr cause) noexcept
 
 extraction_error (jsonv::path path, std::string message) noexcept
 
 extraction_error (jsonv::path path, std::exception_ptr cause) noexcept
 

Detailed Description

Exception thrown if there is any problem running extract.

Definition at line 69 of file serialization.hpp.

Member Typedef Documentation

◆ problem_list

using jsonv::extraction_error::problem_list = std::vector<problem>

Definition at line 115 of file serialization.hpp.

Constructor & Destructor Documentation

◆ extraction_error() [1/2]

jsonv::extraction_error::extraction_error ( problem_list  problems)
explicitnoexcept

Create an extraction_error from the given list of problems.

Parameters
problemsThe list of problems which caused this error. It is expected that problems.size() is greater than 0. If it is not, a single problem will be created with a note about an unspecified error.

◆ extraction_error() [2/2]

jsonv::extraction_error::extraction_error ( jsonv::path  path,
std::string  message,
std::exception_ptr  cause 
)
explicitnoexcept

Create a new extraction_error with a single problem from the given path, message, and optional underlying cause.

Member Function Documentation

◆ nested_ptr()

const std::exception_ptr & jsonv::extraction_error::nested_ptr ( ) const
noexcept

Get the first problem::cause.

This can be nullptr if the first problem does not have an underlying cause.

◆ problems()

const problem_list & jsonv::extraction_error::problems ( ) const
inlinenoexcept

Get the list of problems which caused this extraction_error.

There will always be at least one problem in this list.

Definition at line 144 of file serialization.hpp.


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