ArithmeticException.Message
Module Module1
Sub Main()
Try
AddNumbers(1, 2)
Catch Except As Exception
Console.WriteLine("Call generated error: " & Except.Message)
End Try
End Sub
Function AddNumbers(ByVal A As Integer, ByVal B As Integer) As Integer
Try
Throw New ArithmeticException()
Catch Except As Exception
Console.WriteLine(Except.Message)
End Try
End Function
End Module
Related examples in the same category