Imports System
Imports System.IO
Public Class TestInnerException
Shared Sub Main()
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))
Console.ReadLine()
End Sub