PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD21] - Error Trapping
[WD21] - Error Trapping
Débuté par JP, 19 sep. 2017 11:17 - 2 réponses
Posté le 19 septembre 2017 - 11:17
Hi All

What is the easiest way to implement a single appplication wide error trapping routine? i.e. once the app starts I would like any error at all to be sent to a single error trapping routine which will log the error, inform the user of actions to be taken, and then probably exit the application in an orderly fashion.

TIA
Posté le 19 septembre 2017 - 12:12
Hi JP,

What you are talking about is Exception handling (i.e. a fatal system/program error).

Error handling on the other hand refers usually more to (business) process related errors making it impossible to complete a certain process.
Of course error handling could also be related to an access to a computer resource (lan, wan, nas, db connection, ...) aside of the pure business process and its rules making use of it.

My OOP project posted on the WX repository shows a possible methodology on how you could implement this:
- Exception handling and logging directed to a global method at the (singleton) application class from any WHEN EXCEPTION...DO block
- Error handling and messaging (Info, warning and error levels)

All should be there and work out of the box after simple integration into your project (although it is no longer maintained as I'm moving completely to .net core)...

There's also a pdf in the zip file (and maybe still a video somewhere) explaining how all the pieces work together and how you can implement them in your project.

The download is OOP Framework (Incl Error handling classes)

Best regards,

Peter
Posté le 19 septembre 2017 - 12:30
Peter,

Thanks. WIll have a look.