Error Trapping and Error Line Number

Discussion in 'ASP .Net' started by =?Utf-8?B?UGF1bA==?=, Oct 26, 2005.

  1. 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.
    =?Utf-8?B?UGF1bA==?=, Oct 26, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >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.
    S. Justin Gengo, Oct 26, 2005
    #2
    1. Advertising

  3. 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.
    =?Utf-8?B?UGF1bA==?=, Oct 26, 2005
    #3
  4. =?Utf-8?B?UGF1bA==?=

    Hans Kesting Guest

    Re: =?UTF-8?B?RXJyb3IgVHJhcHBpbmcgYW5kIEVycm9yIExpbmUgTnVtYmVy?=

    > 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.
    Hans Kesting, Oct 27, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hugo
    Replies:
    10
    Views:
    1,289
    Matt Humphrey
    Oct 18, 2004
  2. kaushikshome
    Replies:
    4
    Views:
    752
    kaushikshome
    Sep 10, 2006
  3. Larry Bud
    Replies:
    4
    Views:
    2,172
    Larry Bud
    Jan 28, 2008
  4. scad
    Replies:
    23
    Views:
    1,139
    Alf P. Steinbach
    May 17, 2009
  5. Marek Stepanek
    Replies:
    12
    Views:
    398
    Peter J. Holzer
    Sep 2, 2006
Loading...

Share This Page