Catch without Exception type : Try Catch « Development « VB.Net Tutorial






public class Test
   public Shared Sub Main
        Dim strCaption As String

        strCaption = "Answer"

        Try
            Console.WriteLine(strCaption.Substring(10, 1))
        Catch
            Console.WriteLine("An error has occurred.")
        End Try


   End Sub
End class
An error has occurred.








7.5.Try Catch
7.5.1.Try Catch Exception
7.5.2.Catch Exception throwed from a Method
7.5.3.Catch specific Exception from a Method
7.5.4.Catch different Exception with multiple catch statements
7.5.5.Filtered Exception
7.5.6.Catch without Exception type
7.5.7.Catch custom exception