exception indicating a parse error
More...
#include <json.hpp>
|
| const char * | what () const noexcept override |
| | returns the explanatory string
|
|
| const std::size_t | byte |
| | byte index of the parse error
|
| const int | id |
| | the id of the exception
|
|
| | parse_error (int id_, std::size_t byte_, const char *what_arg) |
|
| std::runtime_error | m |
| | an exception object as storage for error messages
|
exception indicating a parse error
- See also
- https://json.nlohmann.me/api/basic_json/parse_error/
Definition at line 2900 of file json.hpp.
◆ parse_error()
| nlohmann::detail::parse_error::parse_error |
( |
int | id_, |
|
|
std::size_t | byte_, |
|
|
const char * | what_arg ) |
|
inlineprivate |
◆ create() [1/2]
create a parse error exception
- Parameters
-
| [in] | id_ | the id of the exception |
| [in] | pos | the position where the error occurred (or with chars_read_total=0 if the position cannot be determined) |
| [in] | what_arg | the explanatory string |
- Returns
- parse_error object
Definition at line 2913 of file json.hpp.
References nlohmann::BasicJsonType(), nlohmann::detail::position_t::chars_read_total, nlohmann::detail::exception::diagnostics(), nlohmann::detail::exception::name(), parse_error(), and position_string().
Referenced by nlohmann::array_index(), nlohmann::detail::binary_reader< basic_json, InputType >::get_bson_binary(), nlohmann::detail::binary_reader< basic_json, InputType >::get_bson_string(), nlohmann::detail::binary_reader< basic_json, InputType >::get_cbor_binary(), nlohmann::detail::binary_reader< basic_json, InputType >::get_cbor_string(), nlohmann::detail::binary_reader< basic_json, InputType >::get_msgpack_string(), nlohmann::detail::binary_reader< basic_json, InputType >::get_ubjson_high_precision_number(), nlohmann::detail::binary_reader< basic_json, InputType >::get_ubjson_size_type(), nlohmann::detail::binary_reader< basic_json, InputType >::get_ubjson_size_value(), nlohmann::detail::binary_reader< basic_json, InputType >::get_ubjson_string(), nlohmann::detail::binary_reader< basic_json, InputType >::get_ubjson_value(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >::parse(), nlohmann::detail::binary_reader< basic_json, InputType >::parse_bson_element_internal(), nlohmann::detail::binary_reader< basic_json, InputType >::parse_cbor_internal(), nlohmann::detail::binary_reader< basic_json, InputType >::parse_msgpack_internal(), nlohmann::detail::binary_reader< basic_json, InputType >::sax_parse(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >::sax_parse(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >::sax_parse_internal(), nlohmann::split(), and nlohmann::detail::binary_reader< basic_json, InputType >::unexpect_eof().
◆ create() [2/2]
| parse_error nlohmann::detail::parse_error::create |
( |
int | id_, |
|
|
std::size_t | byte_, |
|
|
const std::string & | what_arg, |
|
|
const BasicJsonType & | context ) |
|
inlinestatic |
◆ diagnostics()
| std::string nlohmann::detail::exception::diagnostics |
( |
const BasicJsonType & | leaf_element | ) |
|
|
inlinestaticprotectedinherited |
Definition at line 2830 of file json.hpp.
References nlohmann::a, nlohmann::detail::array, nlohmann::b, nlohmann::BasicJsonType(), nlohmann::detail::binary, nlohmann::detail::boolean, nlohmann::detail::discarded, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, and nlohmann::detail::string.
Referenced by nlohmann::detail::invalid_iterator::create(), nlohmann::detail::other_error::create(), nlohmann::detail::out_of_range::create(), nlohmann::detail::parse_error::create(), nlohmann::detail::parse_error::create(), and nlohmann::detail::type_error::create().
◆ name()
| std::string nlohmann::detail::exception::name |
( |
const std::string & | ename, |
|
|
int | id_ ) |
|
inlinestaticprotectedinherited |
◆ position_string()
| std::string nlohmann::detail::parse_error::position_string |
( |
const position_t & | pos | ) |
|
|
inlinestaticprivate |
◆ what()
| const char * nlohmann::detail::exception::what |
( |
| ) |
const |
|
inlineoverridenoexceptinherited |
returns the explanatory string
Definition at line 2812 of file json.hpp.
References m.
◆ byte
| const std::size_t nlohmann::detail::parse_error::byte |
byte index of the parse error
The byte index of the last read character in the input file.
- Note
- For an input with n bytes, 1 is the index of the first character and n+1 is the index of the terminating null byte or the end of file. This also holds true when reading a byte vector (CBOR or MessagePack).
Definition at line 2938 of file json.hpp.
Referenced by parse_error().
◆ id
| const int nlohmann::detail::exception::id |
|
inherited |
the id of the exception
Definition at line 2818 of file json.hpp.
| std::runtime_error nlohmann::detail::exception::m |
|
privateinherited |
The documentation for this class was generated from the following file: