Can you plz resolve the error of this code...?
Imports System
Imports System.IO
Public Class TestInnerException
Shared Sub Main()
Try
Try
Throw New ArgumentException()
Catch e As ArgumentException
'make sure this path does not exist
If File.Exists("\Bigsky\log.txt") = False Then
Throw New FileNotFoundException("File Not found when trying to write argument exception to the file", e)
End If
End Try
Catch e As Exception
Console.WriteLine([String].Concat(e.StackTrace, e.Message))
If e.InnerException(Nothing) Then
Console.WriteLine("Inner Exception")
Console.WriteLine([String].Concat(e.InnerException.StackTrace, e.InnerException.Message))
End If
End Try
Console.ReadLine()
End Sub
End Class
Manish TewatiaPosted Aug 26, 2010, 2:24 AM
You are right now this code works..
Thank you....
David CarterPosted Aug 26, 2010, 1:00 AM
If e.InnerException(Nothing) Then
Does the following work?
If (e.InnerException Is Nothing) Then
Sorry if I'm off target with this reply.
David