| 669 | } |
| 670 | |
| 671 | void invalidJsonError(const char* data, size_t size, yyjson_read_err* err) { |
| 672 | size_t line = 0, col = 0, chr = 0; |
| 673 | if (yyjson_locate_pos(data, size, err->pos, &line, &col, &chr)) { |
| 674 | throw RuntimeException(std::format("Error {} at line {}, column {}, character index {}", |
| 675 | err->msg, line, col, chr)); |
| 676 | } else { |
| 677 | throw RuntimeException(std::format("Error {} at byte {}", err->msg, err->pos)); |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | JsonWrapper stringToJson(const std::string& str) { |
| 682 | yyjson_read_err err; |