! @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 */
| 10048 | @return a message string to use in the parse_error exceptions |
| 10049 | */ |
| 10050 | std::string exception_message(const input_format_t format, |
| 10051 | const std::string& detail, |
| 10052 | const std::string& context) const |
| 10053 | { |
| 10054 | std::string error_msg = "syntax error while parsing "; |
| 10055 | |
| 10056 | switch (format) |
| 10057 | { |
| 10058 | case input_format_t::cbor: |
| 10059 | error_msg += "CBOR"; |
| 10060 | break; |
| 10061 | |
| 10062 | case input_format_t::msgpack: |
| 10063 | error_msg += "MessagePack"; |
| 10064 | break; |
| 10065 | |
| 10066 | case input_format_t::ubjson: |
| 10067 | error_msg += "UBJSON"; |
| 10068 | break; |
| 10069 | |
| 10070 | case input_format_t::bson: |
| 10071 | error_msg += "BSON"; |
| 10072 | break; |
| 10073 | |
| 10074 | default: // LCOV_EXCL_LINE |
| 10075 | JSON_ASSERT(false); // LCOV_EXCL_LINE |
| 10076 | } |
| 10077 | |
| 10078 | return error_msg + " " + context + ": " + detail; |
| 10079 | } |
| 10080 | |
| 10081 | private: |
| 10082 | /// input adapter |
nothing calls this directly
no outgoing calls
no test coverage detected