Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Error Trapping and Error Line Number

Reply
Thread Tools

Error Trapping and Error Line Number

 
 
=?Utf-8?B?UGF1bA==?=
Guest
Posts: n/a
 
      10-26-2005
I am using a try-catch-finally statement.

In my Catch clause, I trap an error and display the error with the .Message
property of the Exception class.

The problem is that I do not know which line within the code that the error
occurred?

I do not see a property that tells me that.

Does this mean that during the development process, I can not use the try -
catch statement? I do get a message with the line of the error when I do not
use the try catch statement.

TIA.
 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      10-26-2005
Paul,

Different parts of the exception display the line number.

During development I find it best to write the whole exception out when I
trap it with a try catch. So during development I always display ex.ToString



--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Paul" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am using a try-catch-finally statement.
>
> In my Catch clause, I trap an error and display the error with the
> .Message
> property of the Exception class.
>
> The problem is that I do not know which line within the code that the
> error
> occurred?
>
> I do not see a property that tells me that.
>
> Does this mean that during the development process, I can not use the
> try -
> catch statement? I do get a message with the line of the error when I do
> not
> use the try catch statement.
>
> TIA.



 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGF1bA==?=
Guest
Posts: n/a
 
      10-26-2005
Even when I print out the "entire" exception with a .tostring(), it still
does not list the line number?





"Paul" wrote:

> I am using a try-catch-finally statement.
>
> In my Catch clause, I trap an error and display the error with the .Message
> property of the Exception class.
>
> The problem is that I do not know which line within the code that the error
> occurred?
>
> I do not see a property that tells me that.
>
> Does this mean that during the development process, I can not use the try -
> catch statement? I do get a message with the line of the error when I do not
> use the try catch statement.
>
> TIA.

 
Reply With Quote
 
Hans Kesting
Guest
Posts: n/a
 
      10-27-2005
> Even when I print out the "entire" exception with a .tostring(), it still
> does not list the line number?
>
>
>


Did you use it in DEBUG mode?
The linenumber is not shown in the exception message, but in the
stacktrace. Only is debug info is available.

Hans Kesting


>
>
> "Paul" wrote:
>
>> I am using a try-catch-finally statement.
>>
>> In my Catch clause, I trap an error and display the error with the .Message
>> property of the Exception class.
>>
>> The problem is that I do not know which line within the code that the error
>> occurred?
>>
>> I do not see a property that tells me that.
>>
>> Does this mean that during the development process, I can not use the try -
>> catch statement? I do get a message with the line of the error when I do not
>> use the try catch statement.
>>
>> TIA.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
Formview and Sql Error Trapping and Page Validation... Larry Bud ASP .Net 4 01-28-2008 01:52 PM
How to read a text file line by line and remove some line kaushikshome C++ 4 09-10-2006 10:12 PM
OT: Number Nine, Number Nine, Number Nine FrisbeeŽ MCSE 37 09-26-2005 04:06 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM



Advertisments