nlohmann::detail::out_of_range
nlohmann::detail::exception
json.hpp
typename BasicJsonType
out_of_range static out_of_range nlohmann::detail::out_of_range::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::json_pointer< BasicJsonType >::array_index nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::at nlohmann::json_pointer< BasicJsonType >::back nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_entry_header_size nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::erase nlohmann::json_pointer< BasicJsonType >::get_checked nlohmann::json_pointer< BasicJsonType >::get_unchecked nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::patch nlohmann::json_pointer< BasicJsonType >::pop_back nlohmann::detail::parser< BasicJsonType, InputAdapterType >::sax_parse_internal nlohmann::detail::json_sax_dom_parser< BasicJsonType >::start_array nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::start_array nlohmann::detail::json_sax_dom_parser< BasicJsonType >::start_object nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >::start_object nlohmann::detail::binary_writer< BasicJsonType, CharType >::write_bson_unsigned
nlohmann::detail::out_of_range::out_of_range
(int id_, const char *what_arg)
out_of_range
int id_
const char * what_arg

exception indicating access out of the defined range

This exception is thrown in case a library function is called on an input parameter that exceeds the expected range, for instance in case of array indices or nonexisting object keys.

Exceptions have ids 4xx.

name / id | example message | description
json.exception.out_of_range.401 | array index 3 is out of range | The provided array index i is larger than size-1.
json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it.
json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object.
json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved.
json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value.
json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF.
json.exception.out_of_range.407 | number overflow serializing '9223372036854775808' | UBJSON and BSON only support integer numbers up to 9223372036854775807. (until version 3.8.0)
json.exception.out_of_range.408 | excessive array size: 8658170730974374167 | The size (following `#`) of an UBJSON array or object exceeds the maximal capacity.
json.exception.out_of_range.409 | BSON key cannot contain code point U+0000 (at byte 2) | Key identifiers to be serialized to BSON cannot contain code point U+0000, since the key is stored as zero-terminated c-string

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

- 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

- other_error for exceptions indicating other library errors

version 3.0.0

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