fix: Add tool exception for logging purpose

This commit is contained in:
Petr Mironychev
2025-10-21 00:51:42 +02:00
parent c95b20d6d4
commit 7e878cdbf8
9 changed files with 165 additions and 33 deletions

View File

@ -18,6 +18,7 @@
*/
#include "FindSymbolTool.hpp"
#include "ToolExceptions.hpp"
#include <cplusplus/Overview.h>
#include <cplusplus/Scope.h>
@ -157,13 +158,13 @@ QFuture<QString> FindSymbolTool::executeAsync(const QJsonObject &input)
if (symbolName.isEmpty()) {
QString error = "Error: 'symbol_name' parameter is required";
LOG_MESSAGE(error);
throw std::invalid_argument(error.toStdString());
throw ToolInvalidArgument(error);
}
if (useRegex && useWildcard) {
QString error = "Error: 'use_regex' and 'use_wildcard' cannot be used together";
LOG_MESSAGE(error);
throw std::invalid_argument(error.toStdString());
throw ToolInvalidArgument(error);
}
SymbolType type = parseSymbolType(symbolTypeStr);