Paradox Community

Items in pnews.paradox-programming

Subject:Re: error system
Date:Wed, 20 Oct 2021 16:40:41 -0700
From:Peter <peterspammenot@whiteknight.email>
Newsgroups:pnews.paradox-programming
So I have done a lot of research (8 books) on this subject.
As an aside, it surprising how little this topic is addressed in any of 
my books.

One thing that I found consistent between all the books is that we 
should never let the Paradox error handling system present the error to 
the user. Okay I got that.

I made a library that contains code to record errors for diagnostic 
(i.e. me) purposes, no problem and entirely usefull.

As far as presenting my error messages to the user, I sometimes use a 
dialog box and sometimes msgInfo/Stop/Question, I am sure everyone does 
the same.

Now here's the rub:
I test frequently and thus have to add code for the messages to present 
to the user. This gets to be a lot of code and repetitious.

I Can:
1) put custom errors into a table and call them by an id.
  - Advantage is not hard-coded, can be reused by other forms/libs.
  - Disadvantage is that it is cumbersome

2) store the custom errors in a custom method within the same form/lib 
that the code runs.
  - Advantage is that error code is local so easier to maintain
  - Disadvantage is that it cannot be used by any other form/lib.

Anyone have other ideas?



On 09/30/2021 07:47 a.m., Kevin Zawicki wrote:
> If a larger system with multiple forms and libraries you can create a library
> method and pass the info there then have one central place to handle errors.
> 
> But most error trapping is often local to the code at the time
> 
> try {open a file}
> onfail
> errorshow() or errorclear()
> {show message)
> entry
> 
> it depends on errors.
> 
> 
> if a single form the error method at form level can work
> it just depends on how system wide you want to handle errors
> 
> 
> 
> Peter <peterspammenot@whiteknight.email> wrote:
>> I have several traps for errors, many times reporting the same kind of
>> error but with slightly different custom notes appended to describe what
> 
>> caused the error or giving the user instructions.
>>
>> This leads to me inserting the same basic error blocks over and over.
>>
>> I know that the "error" method can be used for this but I don't know
>> how. Any tips on setting up an error system? Thanks.
>>
>>
>> Peter
> 


Copyright © 2004 thedbcommunity.com