| 603 | } |
| 604 | |
| 605 | void 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 | |
| 620 | void EmbeddedShell::run() { |
| 621 | char* line = nullptr; |
no test coverage detected