Solved

Exception messages

Posted on 2004-09-28
3
243 Views
Last Modified: 2010-04-15
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?
0
Comment
Question by:knowlton
  • 2
3 Comments
 
LVL 5

Author Comment

by:knowlton
ID: 12171336
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());
}



0
 
LVL 12

Accepted Solution

by:
geotiger earned 500 total points
ID: 12171576

I think that the both will work, but whether they look the same depends on the message content.
0
 
LVL 5

Author Comment

by:knowlton
ID: 12171757
Can you clarify?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question