MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / exception_message

Method exception_message

Source/Utils/json.hpp:10048–10077  ·  view source on GitHub ↗

! @param[in] format the current format @param[in] detail a detailed error message @param[in] context further context information @return a message string to use in the parse_error exceptions */

Source from the content-addressed store, hash-verified

10046 @return a message string to use in the parse_error exceptions
10047 */
10048 std::string exception_message(const input_format_t format,
10049 const std::string& detail,
10050 const std::string& context) const
10051 {
10052 std::string error_msg = "syntax error while parsing ";
10053
10054 switch (format)
10055 {
10056 case input_format_t::cbor:
10057 error_msg += "CBOR";
10058 break;
10059
10060 case input_format_t::msgpack:
10061 error_msg += "MessagePack";
10062 break;
10063
10064 case input_format_t::ubjson:
10065 error_msg += "UBJSON";
10066 break;
10067
10068 case input_format_t::bson:
10069 error_msg += "BSON";
10070 break;
10071
10072 default: // LCOV_EXCL_LINE
10073 JSON_ASSERT(false); // LCOV_EXCL_LINE
10074 }
10075
10076 return error_msg + " " + context + ": " + detail;
10077 }
10078
10079 private:
10080 /// input adapter

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected