All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | Private Member Functions | List of all members
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

Static Public Member Functions

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

Private Member Functions

 other_error (int id_, const char *what_arg)
 

Additional Inherited Members

- Public Member Functions inherited from nlohmann::detail::exception
JSON_HEDLEY_RETURNS_NON_NULL
const char * 
what () const noexceptoverride
 returns the explanatory string More...
 
- Public Attributes inherited from nlohmann::detail::exception
const int id
 the id of the exception More...
 
- Protected Member Functions inherited from nlohmann::detail::exception
 exception (int id_, const char *what_arg)
 
- Static Protected Member Functions inherited from nlohmann::detail::exception
static std::string name (const std::string &ename, int id_)
 

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

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

Since
version 3.0.0

Definition at line 2160 of file json.hpp.

Constructor & Destructor Documentation

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

Definition at line 2171 of file json.hpp.

2171 : exception(id_, what_arg) {}
exception(int id_, const char *what_arg)
Definition: json.hpp:1879

Member Function Documentation

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

Definition at line 2163 of file json.hpp.

2164  {
2165  std::string w = exception::name("other_error", id_) + what_arg;
2166  return other_error(id_, w.c_str());
2167  }
static std::string name(const std::string &ename, int id_)
Definition: json.hpp:1881
other_error(int id_, const char *what_arg)
Definition: json.hpp:2171

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