Electroneum
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
nlohmann::detail::exception Class Reference

general exception of the basic_json class More...

#include <json.hpp>

Inheritance diagram for nlohmann::detail::exception:
Inheritance graph
[legend]
Collaboration diagram for nlohmann::detail::exception:
Collaboration graph
[legend]

Public Member Functions

virtual const char * what () const noexcept override
 returns the explanatory string More...
 

Public Attributes

const int id
 the id of the exception More...
 

Protected Member Functions

 exception (int id_, const char *what_arg)
 

Static Protected Member Functions

static std::string name (const std::string &ename, int id)
 

Private Attributes

std::runtime_error m
 an exception object as storage for error messages More...
 

Detailed Description

general exception of the basic_json class

Extension of std::exception objects with a member id for exception ids.

Note
To have nothrow-copy-constructible exceptions, we internally use std::runtime_error which can cope with arbitrary-length error messages. Intermediate strings are built with static functions and then passed to the actual constructor.
Since
version 3.0.0

Constructor & Destructor Documentation

◆ exception()

nlohmann::detail::exception::exception ( int  id_,
const char *  what_arg 
)
inlineprotected

Member Function Documentation

◆ name()

static std::string nlohmann::detail::exception::name ( const std::string ename,
int  id 
)
inlinestaticprotected

◆ what()

virtual const char* nlohmann::detail::exception::what ( ) const
inlineoverridevirtualnoexcept

returns the explanatory string

Member Data Documentation

◆ id

const int nlohmann::detail::exception::id

the id of the exception

◆ m

std::runtime_error nlohmann::detail::exception::m
private

an exception object as storage for error messages


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