Error handling in functions? how should I do it?
what's the proper way of doing error handling in a function? This is what I usually do:
VB Code:
Public Shared Sub ResizeImage(ByVal srcPath As String, ByVal destPath As String...
Dim srcImage As Image
Try
srcImage = Image.FromFile(srcPath)
Catch ex As Exception
Throw New ArgumentException("Error opening the source image", "srcPath", ex)
End Try
srcImage.Dispose()
End Sub
should I just let the code throw an exception by itself? or is it better to make a new exception like that?:rolleyes: