nlohmann::detail::exception
std::exception
nlohmann::detail::invalid_iterator
nlohmann::detail::other_error
nlohmann::detail::out_of_range
nlohmann::detail::parse_error
nlohmann::detail::type_error
json.hpp
const int const int nlohmann::detail::exception::id id

the id of the exception

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

an exception object as storage for error messages

const char * const char* nlohmann::detail::exception::what () const noexcept override what

returns the explanatory string

nlohmann::detail::exception::exception
(int id_, const char *what_arg)
exception
int id_
const char * what_arg
std::string static std::string nlohmann::detail::exception::name (const std::string &ename, int id_) name const std::string & ename int id_ nlohmann::to_string nlohmann::detail::parse_error::create nlohmann::detail::invalid_iterator::create nlohmann::detail::type_error::create nlohmann::detail::out_of_range::create nlohmann::detail::other_error::create
typename BasicJsonType
std::string static std::string nlohmann::detail::exception::diagnostics (const BasicJsonType &leaf_element) diagnostics const BasicJsonType & leaf_element nlohmann::detail::array nlohmann::detail::escape nlohmann::detail::object nlohmann::detail::string nlohmann::to_string nlohmann::detail::parse_error::create nlohmann::detail::invalid_iterator::create nlohmann::detail::type_error::create nlohmann::detail::out_of_range::create nlohmann::detail::other_error::create

general exception of the basic_json class

This class is an extension of `std::exception` objects with a member id for exception ids. It is used as the base class for all exceptions thrown by the basic_json class. This class can hence be used as "wildcard" to catch exceptions.

Subclasses:

- parse_error for exceptions indicating a parse error

- invalid_iterator for exceptions indicating errors with iterators

- type_error for exceptions indicating executing a member function with a wrong type

- out_of_range for exceptions indicating access out of the defined range

- other_error for exceptions indicating other library errors

{The following code shows how arbitrary library exceptions can be caught.,exception}

version 3.0.0

nlohmann::detail::invalid_iterator
nlohmann::detail::out_of_range
nlohmann::detail::parse_error
std::exception
nlohmann::detail::type_error
nlohmann::detail::exception
nlohmann::detail::other_error
std::runtime_error
int
std::exception
nlohmann::detail::exception
-m
+id
- nlohmann::detail::exception
  diagnostics
- nlohmann::detail::exception
  exception
- nlohmann::detail::exception
  id
- nlohmann::detail::exception
  m
- nlohmann::detail::exception
  name
- nlohmann::detail::exception
  what