Reputation: 9888
What happens when a Exception is raised on a Try-Finally
block (without catch
) and another exception is raised on the Finally
part?
Example:
Dim aux As String
Try
Try
aux.Split("."c)
Finally
aux = File.ReadAllText("")
End Try
Catch ex As Exception
Console.WriteLine(ex)
End Try
Upvotes: 2
Views: 84
Reputation: 9888
The last thrown exception is catched.
In this case, the ArgumentException from ReadAllText()
on the Finally
block. Ignoring the first exception being thrown.
Upvotes: 3