! @param[in] format the current format @param[in] detail a detailed error message @param[in] context further contect information @return a message string to use in the parse_error exceptions */
| 8264 | @return a message string to use in the parse_error exceptions |
| 8265 | */ |
| 8266 | std::string exception_message(const input_format_t format, |
| 8267 | const std::string& detail, |
| 8268 | const std::string& context) const |
| 8269 | { |
| 8270 | std::string error_msg = "syntax error while parsing "; |
| 8271 | |
| 8272 | switch (format) |
| 8273 | { |
| 8274 | case input_format_t::cbor: |
| 8275 | error_msg += "CBOR"; |
| 8276 | break; |
| 8277 | |
| 8278 | case input_format_t::msgpack: |
| 8279 | error_msg += "MessagePack"; |
| 8280 | break; |
| 8281 | |
| 8282 | case input_format_t::ubjson: |
| 8283 | error_msg += "UBJSON"; |
| 8284 | break; |
| 8285 | |
| 8286 | case input_format_t::bson: |
| 8287 | error_msg += "BSON"; |
| 8288 | break; |
| 8289 | |
| 8290 | // LCOV_EXCL_START |
| 8291 | default: |
| 8292 | assert(false); |
| 8293 | // LCOV_EXCL_STOP |
| 8294 | } |
| 8295 | |
| 8296 | return error_msg + " " + context + ": " + detail; |
| 8297 | } |
| 8298 | |
| 8299 | private: |
| 8300 | /// input adapter |
nothing calls this directly
no outgoing calls
no test coverage detected