Lines Matching defs:exception
185 #include <exception> // exception
2507 #define JSON_THROW(exception) throw exception
2509 #define JSON_CATCH(exception) catch(exception)
2510 #define JSON_INTERNAL_CATCH(exception) catch(exception)
2513 #define JSON_THROW(exception) std::abort()
2515 #define JSON_CATCH(exception) if(false)
2516 #define JSON_INTERNAL_CATCH(exception) if(false)
2519 // override exception macros
4298 /// @brief general exception of the @ref basic_json class
4299 /// @sa https://json.nlohmann.me/api/basic_json/exception/
4300 class exception : public std::exception
4309 /// the id of the exception
4314 exception(int id_, const char* what_arg) : id(id_), m(what_arg) {} // NOLINT(bugprone-throw-keyword-missing)
4318 return concat("[json.exception.", ename, '.', std::to_string(id_), "] ");
4392 /// an exception object as storage for error messages
4396 /// @brief exception indicating a parse error
4398 class parse_error : public exception
4402 @brief create a parse error exception
4403 @param[in] id_ the id of the exception
4413 std::string w = concat(exception::name("parse_error", id_), "parse error",
4414 position_string(pos), ": ", exception::diagnostics(context), what_arg);
4421 std::string w = concat(exception::name("parse_error", id_), "parse error",
4423 ": ", exception::diagnostics(context), what_arg);
4440 : exception(id_, what_arg), byte(byte_) {}
4449 /// @brief exception indicating errors with iterators
4451 class invalid_iterator : public exception
4457 std::string w = concat(exception::name("invalid_iterator", id_), exception::diagnostics(context), what_arg);
4464 : exception(id_, what_arg) {}
4467 /// @brief exception indicating executing a member function with a wrong type
4469 class type_error : public exception
4475 std::string w = concat(exception::name("type_error", id_), exception::diagnostics(context), what_arg);
4481 type_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
4484 /// @brief exception indicating access out of the defined range
4486 class out_of_range : public exception
4492 std::string w = concat(exception::name("out_of_range", id_), exception::diagnostics(context), what_arg);
4498 out_of_range(int id_, const char* what_arg) : exception(id_, what_arg) {}
4501 /// @brief exception indicating other library errors
4503 class other_error : public exception
4509 std::string w = concat(exception::name("other_error", id_), exception::diagnostics(context), what_arg);
4515 other_error(int id_, const char* what_arg) : exception(id_, what_arg) {}
6698 @param[in] ex an exception object describing the error
6703 const detail::exception& ex) = 0;
7289 bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const detail::exception& /*unused*/)
9025 using exception_t = typename BasicJsonType::exception;
9056 using exception_t = typename BasicJsonType::exception;
9095 "std::string&, const exception&)");
9115 error, ///< throw a parse_error exception in case of a tag
17929 strict, ///< throw a type_error exception in case of invalid UTF-8
19296 friend class ::nlohmann::detail::exception;
19362 using exception = detail::exception;
19553 /// helper for exception-safe object creation
19991 basic_json(std::nullptr_t = nullptr) noexcept // NOLINT(bugprone-exception-escape)
20003 basic_json(CompatibleType && val) noexcept(noexcept( // NOLINT(bugprone-forwarding-reference-overload,bugprone-exception-escape)
20091 // if object is wanted but impossible, throw an exception
21115 // create better exception explanation
21138 // create better exception explanation
22661 void swap(array_t& other) // NOLINT(bugprone-exception-escape)
22677 void swap(object_t& other) // NOLINT(bugprone-exception-escape)
22693 void swap(string_t& other) // NOLINT(bugprone-exception-escape)
22709 void swap(binary_t& other) // NOLINT(bugprone-exception-escape)
22725 void swap(typename binary_t::container_type& other) // NOLINT(bugprone-exception-escape)
24095 // throw an exception if test fails