CellModules
nlohmann::detail::other_error Class Reference

exception indicating other library errors More...

#include <json.hpp>

Inheritance diagram for nlohmann::detail::other_error:
nlohmann::detail::exception

Public Member Functions

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

Static Public Member Functions

static other_error create (int id_, const std::string &what_arg)
 

Public Attributes

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

Static Protected Member Functions

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

Private Member Functions

 other_error (int id_, const char *what_arg)
 

Private Attributes

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

Detailed Description

exception indicating other library errors

This exception is thrown in case of errors that cannot be classified with the other exception types.

Exceptions have ids 5xx.

name / id example message description
json.exception.other_error.501 unsuccessful: {"op":"test","path":"/baz", "value":"bar"} A JSON Patch operation 'test' failed. The unsuccessful operation is also printed.
See also
- exception for the base class of the library exceptions
- 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

@liveexample{The following code shows how an other_error exception can be caught.,other_error}

Since
version 3.0.0

Definition at line 436 of file json.hpp.

Constructor & Destructor Documentation

◆ other_error()

nlohmann::detail::other_error::other_error ( int  id_,
const char *  what_arg 
)
inlineprivate

Definition at line 446 of file json.hpp.

Member Function Documentation

◆ create()

static other_error nlohmann::detail::other_error::create ( int  id_,
const std::string &  what_arg 
)
inlinestatic

Definition at line 439 of file json.hpp.

◆ name()

static std::string nlohmann::detail::exception::name ( const std::string &  ename,
int  id_ 
)
inlinestaticprotectedinherited

Definition at line 160 of file json.hpp.

◆ what()

const char * nlohmann::detail::exception::what ( ) const
inlineoverridenoexceptinherited

returns the explanatory string

Definition at line 149 of file json.hpp.

Member Data Documentation

◆ id

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

the id of the exception

Definition at line 155 of file json.hpp.

◆ m

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

an exception object as storage for error messages

Definition at line 167 of file json.hpp.


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