Northwind 2.2 Global Error Handlers vs vbWatchdog (1 Viewer)

KevinBaker

New member
Local time
Today, 04:57
Joined
Aug 23, 2020
Messages
22
Hi Everyone!

I watched the video today with Tom and Kim about the Global Error Handlers update coming in Northwind 2.2.

My backstory. I starting rewriting (in Access) a 20+ year application written in Paradox about 2 years ago. I was kind of new to Access, so we decided to just use vbWatchdog, which allowed us to get things moving along without worrying about error handling.

The video today really taught me a lot and I'd really like to replace vbWatchdog with what I saw today. Nothing against vbWatchdog, it has worked well, but it's a lot of code I don't understand and I that makes me a bit nervous.

I'm thinking about (over the next few months and once 2.2 is out) to start the process of adding error handling into my code. I think I read somewhere that if a Sub has it's own error handling, then vbWatchdog will let the sub handle any errors.

I just wanted to get some feedback on this plan.

Thanks,
Kevin
 

Josef P.

Well-known member
Local time
Today, 10:57
Joined
Feb 2, 2023
Messages
826
I also use vbWatchdog because it allows me to reproduce the errors much better.
vbWatchdog provides much more information for troubleshooting (e. g.: call stack with value of parameters and variables).

... but it's a lot of code I don't understand and I that makes me a bit nervous.
Think of vbWatchdog like a library embedded in codemoduls. You must be using DAO (ACEDAO.dll). Have you checked the code yet? ;)

I think I read somewhere that if a Sub has it's own error handling, then vbWatchdog will let the sub handle any errors.
You can implement it this way. You can also react to the errors with vbWatchdog in a procedure with its own error handler.
 
Last edited:

KevinBaker

New member
Local time
Today, 04:57
Joined
Aug 23, 2020
Messages
22
Thanks Josef P. I do like the information (most of it I don't understand) in vbWatchdog. I haven't found much in the way of tutorials and the help is full of info, just a bit over my head. After watching the video from Tom I felt like I better understanding of adding my own error handling.

Yes, I use DAO (if you mean like DAO.Database, DAO.Recordset, etc). What code?

For now, once 2.2 is out I'll convert a couple of subs and see how it goes.

Thanks again,
Kevin
 

Josef P.

Well-known member
Local time
Today, 10:57
Joined
Feb 2, 2023
Messages
826
I meant the code that was used to create the DAO library. You don't check that either and use the library. But at vbWatchdog you don't feel good if you don't understand all the code? ;)
Some modules of vbWatchdog are to be regarded as library. They are included in VBProject, because no additional dll is needed for vbWatchdog - the "dll" is in the modules.

Understanding error handling in principle never hurts. :)
I myself use vbWatchdog for global error handling. If I want to react explicitly to an error or e.g. clean up after an error, I use the normal error handling which is possible with VBA and do not use e.g. Try-Catch from vbWatchdog.
So I am not dependent on vbWatchdog in my reusable code.
 

KevinBaker

New member
Local time
Today, 04:57
Joined
Aug 23, 2020
Messages
22
Oh, I see what you mean about the code in the DAO library.

Understanding error handling in principle never hurts. :)
I think at some level adding the error handling may help me write better code or at least give me a better understanding of the code I have.
 

Josef P.

Well-known member
Local time
Today, 10:57
Joined
Feb 2, 2023
Messages
826
I think at some level adding the error handling may help me write better code or at least give me a better understanding of the code I have.
That is definitely true. Good error handling is easiest to create with well-structured code.
If a procedure is very long and covers multiple tasks, I think it is best to split the method into individual methods per task. Then you don't have to consider multiple exit points for error handling.
 

Users who are viewing this thread

Top Bottom