Hello all,
I'm just wondering what is considered better:
Let's say I have a function that may throw an error, and I would like to catch it. I write here 2 options that I use, please tell me what you think is better. If you have some better option, please let me know. Thanks!
Option a is:
option b is:
I'm just wondering what is considered better:
Let's say I have a function that may throw an error, and I would like to catch it. I write here 2 options that I use, please tell me what you think is better. If you have some better option, please let me know. Thanks!
Option a is:
Code:
function ....()
On error resume next
...
a command that might fail
if err.number <> 0 then
....
resume next
endif
option b is:
Code:
function ...()
on error goto errHandle
...
a command that might fail
...
exit function
errHandle:
if err.number <> 0 then
...
resume next
endif