The Visual Studio debugger allows you to configure it to break when exceptions are thrown. The settings are found in the Debug->Windows->Exception Settings window. For example,
I don't know if this will help in your particular situation. In the posted image I checked the "All C++ Exeptions Not in this list" box so that the debugger would break if an unsigned long was thrown.
You can test the settings -
// CppException.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <stdexcept>
int main()
{
try
{
throw std::exception("C++ exception");
}
catch (const std::exception& ex)
{
std::cout << "Caught exception " << ex.what() << std::endl;
}
try
{
throw (unsigned long)42;
}
catch (unsigned long ul)
{
std::cout << "Caught exception " << ul << std::endl;
}
return 0;
}