! @brief exception indicating executing a member function with a wrong type This exception is thrown in case of a type error; that is, a library function is executed on a JSON value whose type does not match the expected semantics. Exceptions have ids 3xx. name / id | example message | description -----------------------------
| 2562 | @since version 3.0.0 |
| 2563 | */ |
| 2564 | class type_error : public exception |
| 2565 | { |
| 2566 | public: |
| 2567 | static type_error create(int id_, const std::string& what_arg) |
| 2568 | { |
| 2569 | std::string w = exception::name("type_error", id_) + what_arg; |
| 2570 | return type_error(id_, w.c_str()); |
| 2571 | } |
| 2572 | |
| 2573 | private: |
| 2574 | JSON_HEDLEY_NON_NULL(3) |
| 2575 | type_error(int id_, const char* what_arg) : exception(id_, what_arg) {} |
| 2576 | }; |
| 2577 | |
| 2578 | /*! |
| 2579 | @brief exception indicating access out of the defined range |