Option Strict Off
Public Module Tester
Public Sub Main
Dim a, b As Integer
Try
a = 0
b = 0
a = a/b
Catch e As DivideByZeroException When a = 0
Console.WriteLine("Division by zero error: " & _
"the first divisor must not be zero.")
Catch e As DivideByZeroException When b = 0
Console.WriteLine("Division by zero error: " & _
"the second divisor must not be zero.")
Catch e As Exception
Console.WriteLine("Error: " & e.Message)
End Try
End Sub
End Module
Error: Arithmetic operation resulted in an overflow.