Solved

Exception messages

Posted on 2004-09-28
3
258 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Author Comment

by:Tom 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:Tom Knowlton
ID: 12171757
Can you clarify?
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

627 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