Welcome! Log In Create A New Profile

Advanced

Automatic Error Procedure

Posted by kewpe20 
kewpe20
Automatic Error Procedure
September 30, 2008 09:09PM
I would like to create a Global Automatic Error Procedure. I read the help regarding Automatic Error Procedures, which according to the instructions, needs to be actived for each individual section of code.

Before I start setting this up for every code section of my entire application, I'm wondering if there is a more efficient way to setup the Automatic Error Procudure system wide.

My question is...is there a way to set up a Global Automatic Error Procedure.

Thanks in advance for your responses....
Georgio
Re: Automatic Error Procedure
September 30, 2008 10:14PM
Hi,

What kind of errors are you looking to trap? Native to Windev or your own programming?

What I've done to trap errors was create a message console and then a global procedure that logs any errors or notices into a file. From there, we ftp it to our
website so we can check up on any errors a client may have before they know
about it.

Are you looking for something along these lines?

Georgio
Glenn Rathke
Re: Automatic Error Procedure
October 01, 2008 02:34AM
Hi,

From what I read it looks like he is wanting to trap the errors at a high level instead of having to trap them at each procedure... correct me if I'm wrong kewpe20

I'd imagine he is trying to trap file related errors since almost everything else can be handled directly through the code he has been writing.

I've got a similar need, so I'm probably reading between the lines here. How can you trap for file errors, specifically if a connecton has been lost at almost any point in the application.

Glenn
Fabrice Harari
Re: Automatic Error Procedure
October 01, 2008 04:56PM
Hello everybody...

if by errors you mean exceptions, then you can put a when exception section in the project init code and it will be active for the whole project... In fact, the exception handling follows the same schema than for the variable declaration (whole project, window, class, or local code), so yo can have a genral handling and overwrite it locally...

Don't forget to REACTIVATE the exception handling in the exception handling code if you are not terminating the program...

Also remember that exception handling yanks you out of your code, so NOT terminating the program can create other problems down the line:
- you suddenly have a code that was not finished
- what is the code?
- what is it doing?
- Does it need correcting the files?

If you have a GENERIC handling only, it's difficult to manage each specific case correctly

Hope this help

Fabrice Harari
WinDev, WebDev, WinDev Mobile consulting
Paulo Oliveira
Re: Automatic Error Procedure
October 01, 2008 06:02PM
if you are talking about file access errors, you can put HOnError in the project init code and it work for all the project.
if you use hErrAll you can make one procedure to deal with all the errors.
DW
Re: Automatic Error Procedure
October 01, 2008 07:12PM
Hello Paulo or Frabrice,

Could you elaborate on how to trap a timeout error for client server.

Dennis
Fabrice Harari
Re: Automatic Error Procedure
October 01, 2008 08:22PM
Hi Again

you can look at the 'exception' keyword in the help file for all the different methods to trap exceptions (not only files errors, but anything not managed somewhere)...

WHEN EXCEPTION is one of the syntax, and allows you to display friendly messages, log the error, send it via email, etc...

Just remember that depending on the cause of the problem, some things may not work, so start by logging, displaying error, and then go to email and such

Best regards

Fabrice
kewpe20
Re: Automatic Error Procedure
October 01, 2008 11:12PM
At this stage of my Application all I need is a Generic Global Error and Exception Handling Process.
Based off your responses the best solution is to activate the If Error: run CASE ERROR and When Exception: run CASE ERROR in the Project Initialization code.

As I continue to work on the app I can provide specific error messages for specific situations.

I have not tested how this will handle a Time Out Issue or Connection problem. I will post that info when I find out.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: