Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Catching line number in exception
Message
From
11/01/2005 10:15:24
 
 
To
09/01/2005 16:33:12
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
00975541
Message ID:
00976029
Views:
15
This message has been marked as the solution to the initial question of the thread.
Hi Michel,

I print the Exception.stacktrace which has a lot of info including the line number. In VB.Net this looks like this:
 Try
 'some stuff
 Catch ex As Exception
     Me.LogMessage(ex.Message + ex.StackTrace, EventLogEntryType.Error)
 End Try
Note: FYI LogMessage is a special function that puts the message in the windows event log I made...
    Private Sub LogMessage(ByVal Message As String, ByVal EventType As EventLogEntryType)
        'Sticks a message in the windows event 
        'log in the windows event log
        Dim WinEventLog As New EventLog

        ' Check if the the Event Log Exists
        If Not WinEventLog.SourceExists("sOliver DB2 Integration") Then
            WinEventLog.CreateEventSource("sOliver DB2 Integration", "sOliver DB2 Integration") ' Create Log
        End If
        WinEventLog.Source = "sOliver DB2 Integration"
        ' Write to the Log

        WinEventLog.WriteEntry("sOliver DB2 Integration", Message, EventType)    'EventLogEntryType.Information)
    End Sub
BR
Tim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform