Hi,
Can somebody please advice me on raising/throwing custom exceptions?
Here is what I'm trying to do.
//MainFunction() will call SubFunction() to perform some ADO function.
MainFunction()
{
try
{
SubFunction()
//OtherFunction1
//OtherFunction2
}
catch(...)
{
//to catch custom exceptions raised by me in SubFunction() so that it will bypass execution of OtherFunction1 and OtherFunction2.
}
}
SubFunction()
{
try
{
//Perform ADOfunction such as SELECT statement
//Raise my own exception to be caught by catch(...) in this function.
{
catch (CADOException e)
{
}
catch(...)
{
//Catch own exception raised so that I can do my own processing.
//After doing my own processing raise another exception to be caught by MainFunction.
}
}
I've search the internet but couldn't find much info on catch(...).
By the way, in my searching of internet, i found that some people use "throw" to raise exception and some use "RaiseException".
Which one should I use to bypass OtherFunction1 and OtherFunction2?
Another thing is what should I do to supress the message box that prompt up when error occur?