Solved

Exception messages

Posted on 2004-09-28
3
227 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now