Summary
mps_parser_throw() (in cpp/src/io/utilities/error.hpp) concatenates msg verbatim into a JSON string. A token, file path, or system error message containing ", \, or a newline will produce malformed JSON and break any downstream consumer expecting the MPS_PARSER_ERROR_TYPE / msg structure.
Suggested fix
Add a small json_escape(const std::string&) helper that replaces \, ", \n, \r, and \t with their JSON-escaped forms, and apply it when constructing the thrown std::logic_error message in mps_parser_throw.
References
Summary
mps_parser_throw()(incpp/src/io/utilities/error.hpp) concatenatesmsgverbatim into a JSON string. A token, file path, or system error message containing",\, or a newline will produce malformed JSON and break any downstream consumer expecting theMPS_PARSER_ERROR_TYPE/msgstructure.Suggested fix
Add a small
json_escape(const std::string&)helper that replaces\,",\n,\r, and\twith their JSON-escaped forms, and apply it when constructing the thrownstd::logic_errormessage inmps_parser_throw.References