Solved

Exception messages

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

13 Experts available now in Live!

Get 1:1 Help Now