nlohmann::detail::other_error
nlohmann::detail::exception
json.hpp
typename BasicJsonType
other_error static other_error nlohmann::detail::other_error::create (int id_, const std::string &what_arg, const BasicJsonType &context) create int id_ const std::string & what_arg const BasicJsonType & context nlohmann::detail::exception::diagnostics JSON_HEDLEY_NON_NULL nlohmann::detail::exception::name nlohmann::detail::string nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::json_value nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::patch
nlohmann::detail::other_error::other_error
(int id_, const char *what_arg)
other_error
int id_
const char * what_arg

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.

- 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}

version 3.0.0

std::exception
nlohmann::detail::exception
nlohmann::detail::other_error
std::runtime_error
int
std::exception
nlohmann::detail::exception
-m
+id
nlohmann::detail::other_error
- nlohmann::detail::other_error
  create
- nlohmann::detail::other_error
  diagnostics
- nlohmann::detail::other_error
  exception
- nlohmann::detail::other_error
  id
- nlohmann::detail::other_error
  name
- nlohmann::detail::other_error
  other_error
- nlohmann::detail::other_error
  what