I have the following function that was written by someone else, however I am rewriting this application and I was just wondering if there isn't any better way to do exception handling, besides just returning what was originally passed to the function?
CComVariant GetFldVar(ADO_RsPtr rs, long nIndex, CComVariant def)
{
try
{
return rs->GetFields()->GetItem(nIndex)->GetValue();
}
catch (...)
{
return def; // catch exception and just return old variable?? Is that the right way to go about things??
}
}