PDA

View Full Version : error handler



Ian Telfer
14-Jul-2005, 03:56 AM
Hi All,

Has anyone done any work on improving the error message the system
generates, to make them a bit more user friendly. I'm sure I read
something some time ago, but cannot find any mention in the NG.

Basically remove errors like duplicate not allowed etc.

Any suggestions as to an easy way to start the process would be very
welcomed

Thanks

Ian

Marco
14-Jul-2005, 07:32 PM
Ian,

Start with putting in your webapp.src:

Property Integer piErrorHandle
Property Integer piDefaultError_Object_ID Error_Object_ID
Procedure Error_Report Integer iErrNum Integer iErrLine String sErrMsg
Integer iError_Object_ID
If (piErrorHandle(Self)=0) Begin
If (iErrNum = 28) Begin
Get piDefaultError_Object_ID To iError_Object_ID
Set piErrorHandle To 1
Send Error_Report To iError_Object_ID iErrNum iErrLine
'You have already a simular record'
Set piErrorHandle To 0
End
End
End_Procedure
Move Self To Error_Object_ID

The above is probably very buggy, but should get you started. You
probably want to store your 'personalised' error messages per DD, so
you can build on this.

Cheers,
Marco

Ian Telfer
15-Jul-2005, 05:27 AM
Marco,

Thanks for the tip. I'll work on that & see how I go.

Cheers

Ian

Marco Kuipers wrote:
> Ian,
>
> Start with putting in your webapp.src:
>
> Property Integer piErrorHandle
> Property Integer piDefaultError_Object_ID Error_Object_ID
> Procedure Error_Report Integer iErrNum Integer iErrLine String sErrMsg
> Integer iError_Object_ID
> If (piErrorHandle(Self)=0) Begin
> If (iErrNum = 28) Begin
> Get piDefaultError_Object_ID To iError_Object_ID
> Set piErrorHandle To 1
> Send Error_Report To iError_Object_ID iErrNum iErrLine
> 'You have already a simular record'
> Set piErrorHandle To 0
> End
> End
> End_Procedure
> Move Self To Error_Object_ID
>
> The above is probably very buggy, but should get you started. You
> probably want to store your 'personalised' error messages per DD, so
> you can build on this.
>
> Cheers,
> Marco