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

Method printErrorMessage

tools/shell/embedded_shell.cpp:605–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603}
604
605void EmbeddedShell::printErrorMessage(std::string input, QueryResult& queryResult) {
606 input = input.erase(input.find_last_not_of(" \t\n\r\f\v") + 1);
607 std::string errMsg = queryResult.getErrorMessage();
608 printf("Error: %s\n", errMsg.c_str());
609 if (errMsg.find(ParserException::ERROR_PREFIX) == 0) {
610 std::string trimmedinput = input;
611 trimmedinput.erase(0, trimmedinput.find_first_not_of(" \t\n\r\f\v"));
612 if (trimmedinput.find_first_of(" \t\n\r\f\v") == std::string::npos) {
613 printf("\"%s\" is not a valid Cypher query. Did you mean to issue a "
614 "CLI command, e.g., \"%s\"?\n",
615 input.c_str(), findClosestCommand(input).c_str());
616 }
617 }
618}
619
620void EmbeddedShell::run() {
621 char* line = nullptr;

Callers 1

processRunCommandsFunction · 0.80

Calls 4

findClosestCommandFunction · 0.85
eraseMethod · 0.80
getErrorMessageMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected