Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

Exception messages

What is the difference between:


//uses   ex

genFuncs.SendMessage("tom@buyersfund.com","Error deleting EML file in WindowsServiceTrackRequest CLASS:  ClassGetStatus Method:  DelFile","PATH:  " + sUri + "\n\n\nERROR MESSAGE:  " + ex);

and


//uses   ex.ToString()

genFuncs.SendMessage("tom@buyersfund.com","Error deleting EML file in WindowsServiceTrackRequest CLASS:  ClassGetStatus Method:  DelFile","PATH:  " + sUri + "\n\n\nERROR MESSAGE:  " + ex.ToString());



Will both work and look the same?
Avatar of Tom Knowlton
Tom Knowlton
Flag of United States of America image

ASKER

NOTE:    the var ex      is a variable of type Exception....as in:

catch(Exception ex)
{
genFuncs.SendMessage("tom@buyersfund.com","Error deleting EML file in WindowsServiceTrackRequest CLASS:  ClassGetStatus Method:  DelFile","PATH:  " + sUri + "\n\n\nERROR MESSAGE:  " + ex);
}


or


catch(Exception ex)
{
genFuncs.SendMessage("tom@buyersfund.com","Error deleting EML file in WindowsServiceTrackRequest CLASS:  ClassGetStatus Method:  DelFile","PATH:  " + sUri + "\n\n\nERROR MESSAGE:  " + ex.ToString());
}



ASKER CERTIFIED SOLUTION
Avatar of geotiger
geotiger

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you clarify?