Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output window shows thrown exceptions

So I am working on exception handling and I used a try-catch to solve an issue with converting strings to integers. The project runs fine, but if I look in the output window, multiple messages like this one show up:

Exception thrown at 0x00007FFB7ACE3B29 in CPP-eindopdracht.exe: Microsoft C++ exception: std::invalid_argument at memory location 0x0000006DF9B3ECC0.

Does that mean my exception handling isn't working properly or is this always what the output window of VS2019 shows you anyway?

Thanks.

Edit:

Here is where the exception thrown message is generated when debugging:

bool Interpreter::tryConvertToInt(std::string convertible, int& value)
{
    try
    {
        value = std::stoi(convertible); // Also accepts "123abc" as a valid conversion. No problem for now but keep in mind.
        return true;
    }
    catch (...)
    {
        //std::cout << "Conversion from " << convertible << " to integer is not possible..." << std::endl;
        return false;
    }
}

However, as you can see I'm dealing with the exception, so I don't understand why the message is being shown in the output tab.

like image 338
WolfyDoo Avatar asked Sep 01 '25 20:09

WolfyDoo


1 Answers

Your exception handling is working properly. From my tests, it looks like the Debug Output window in Visual Studio always shows the exceptions.

like image 177
krisz Avatar answered Sep 04 '25 21:09

krisz