G
Guest
In my opinion rethrowing exceptions without providing anny extra information
is a totall waste
Examples :
in my opinion wrong :
A:
Public sub DoSomeStuff()
Try
do it
Catch ex As Exception
Throw New Exception(ex.tostring )
End Try
End sub
in my opinion plausible
B:
Public sub DoSomeStuff()
Try
do it
Catch ex As Exception
Throw New Exception("extra info about this exception ",ex)
End Try
End sub
In my opinion most common if this method is in a parent exception handler
C:
Public sub DoSomeStuff()
do it
End sub
please note that the three versions are beeing called in a parent exception
handler
However some people here seem to stick with version A
I told them this is a waste of resources , they on the other hand tell me i
am wrong , as the exception would not be bubled up , if you do not rethrow (
ofcourse i tested this and on my comp it does )
I would like to hear your throughts about the subject
Regards
Michel
is a totall waste
Examples :
in my opinion wrong :
A:
Public sub DoSomeStuff()
Try
do it
Catch ex As Exception
Throw New Exception(ex.tostring )
End Try
End sub
in my opinion plausible
B:
Public sub DoSomeStuff()
Try
do it
Catch ex As Exception
Throw New Exception("extra info about this exception ",ex)
End Try
End sub
In my opinion most common if this method is in a parent exception handler
C:
Public sub DoSomeStuff()
do it
End sub
please note that the three versions are beeing called in a parent exception
handler
However some people here seem to stick with version A
I told them this is a waste of resources , they on the other hand tell me i
am wrong , as the exception would not be bubled up , if you do not rethrow (
ofcourse i tested this and on my comp it does )
I would like to hear your throughts about the subject
Regards
Michel