MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / invalidJsonError

Function invalidJsonError

src/common/json_utils.cpp:671–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671void 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
681JsonWrapper stringToJson(const std::string& str) {
682 yyjson_read_err err;

Callers 1

stringToJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected