Solved

Error handling, Server.GetLastError()

Posted on 2003-11-10
1
861 Views
Last Modified: 2012-05-04
Hi

I am trying to get more detailed error information using Server.GetLastError(), I see on the web that one can retreive this stuff:

.ASPCode
.Number
.Source
.File
.Line

However this does not work for me, I can only get this stuff and want the above goodies.

.Message
.StackTrace
.Source

please help, do I have a wrong version of .net framework or something?
0
Comment
Question by:iqula
1 Comment
 
LVL 23

Accepted Solution

by:
naveenkohli earned 125 total points
ID: 9715616
You already have this information. StackTrace will help you to get to the file name and line number. Take a look at this code snippet from documentation.

Public Shared Sub Main()

        Try
            Dim sts As New StackTraceSample()
            sts.MyPublicSub()
        Catch
            ' Create a StackTrace that does not capture filename, line number or column information.
            Dim strace As New StackTrace()
            Dim count As Integer

            ' High up the call stack, there is only one stack frame
            While count < strace.FrameCount
                Dim frame As New StackFrame()
                frame = strace.GetFrame(count)
                Console.WriteLine("High Up the Call Stack, Method: {0}", frame.GetMethod())
                Console.WriteLine("High Up the Call Stack, Line Number: {0}", frame.GetFileLineNumber())
                count = count + 1
            End While

        End Try

    End Sub
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

Suggested Solutions

Title # Comments Views Activity
Saveas need to save a copy 16 26
asp.net mvc input file 2 32
Runtime Error 2 27
Change Format on Data when exporting to Excel 4 22
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

10 Experts available now in Live!

Get 1:1 Help Now