From 688f490ec144eaba7c872ef0cd3018349f65c341 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 1 Apr 2026 23:42:38 +0300 Subject: [PATCH] Added a stringstream object to concatenate strings when building exception message --- input_resolver.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/input_resolver.cpp b/input_resolver.cpp index 003eaac..c35320c 100644 --- a/input_resolver.cpp +++ b/input_resolver.cpp @@ -1,6 +1,7 @@ #include "input_resolver.h" #include #include +#include #define delimiter " " @@ -63,7 +64,9 @@ Command resolveCommand() auto validation_result = validate_token(token); if (!validation_result.ok()) { - throw std::runtime_error{"invalid token " + validation_result.incorrect_token()}; + std::ostringstream os; + os << "invalid token "<< validation_result.incorrect_token(); + throw std::runtime_error{os.str()}; } bool shouldQuit = token.find("q") != token.npos;