M
Max Moor
Hi All,
I've been trying over the years to keep in the habit of putting error
handlers in my VB code. My guess is that I go overboard sometimes, putting
an error handler in a trivial sub. Othertimes, I find that I didn't go far
enough, forgetting to put one in a function that calls an SQL execute.
Having never been taught better, I'd say my rules are pretty simple...
I don't bother in trivial cases, like an event procedure that just calls
another function. I put the error code in the called function.
Otherwise, I put it in...
...any function where recordsets are being accessed or (especially)
modified.
...any function that accesses operating system or file system calls.
...any function that creates or destroys objects of any kind.
...any code I write that I look at and say, "I hope no one else ever sees
this."
...any code that futzes around in an object module I've created myself.
(I'm still new at object modules)
...any code i'm not sure of one way or the other.
All that said, deciding whether to Resume Next or bail is a whole
other set of fuzzy logic.
I'm wondering what rules of thumb others have developed for
themselves? Aside from being curious, I'd like to learn more on the
subject.
Regards,
Max
I've been trying over the years to keep in the habit of putting error
handlers in my VB code. My guess is that I go overboard sometimes, putting
an error handler in a trivial sub. Othertimes, I find that I didn't go far
enough, forgetting to put one in a function that calls an SQL execute.
Having never been taught better, I'd say my rules are pretty simple...
I don't bother in trivial cases, like an event procedure that just calls
another function. I put the error code in the called function.
Otherwise, I put it in...
...any function where recordsets are being accessed or (especially)
modified.
...any function that accesses operating system or file system calls.
...any function that creates or destroys objects of any kind.
...any code I write that I look at and say, "I hope no one else ever sees
this."
...any code that futzes around in an object module I've created myself.
(I'm still new at object modules)
...any code i'm not sure of one way or the other.
All that said, deciding whether to Resume Next or bail is a whole
other set of fuzzy logic.
I'm wondering what rules of thumb others have developed for
themselves? Aside from being curious, I'd like to learn more on the
subject.
Regards,
Max