Error Handling

<< Click to Display Table of Contents >>

Navigation:  The Vo2Ado RDD > Basics >

Error Handling

Previous pageReturn to chapter overviewNext page

The Vo2Ado RDD uses the standard VO structured error handling. Every time an error occurs in the RDD, a VO Error object is generated with at least the following properties filled:

Subsystem

 

Vo2Ado

 

GenCode

 

EG_OPEN, EG_READ, EG_WRITE, EG_CLOSE

 

FuncSym

 

The RDD method that caused the failure

 

SubError

 

A number between 2000 and 2046 indicating an error code (see list below)

 

Description

 

A textual description of the error

 

 

If you have setup a local or global error handler you can catch this error and decide what to do.

 

If you are using the RDD with the VO DbServer class you should note the following:

 

If you are using the DbServer object without a client (not on a DataWindow, DataBrowser, DataListView), the DbServer class will catch the error, and store it in its ErrInfo property. It will also create a Status hyper label and finally will call your local or global error handler.

 

If you are using the DbServer object with a client object, the DbServer class will also fill the ErrInfo and Status properties, but will not call the local error handler. In stead it will call the Error method of the first client attached.  Unfortunately the default implementation of the Error method on the DataWindow and DataBrowser classes is empty. So you will get no error messages ! We advise to create a useful Error method in your DataWindow subclass.

 

Finally there is a problem in the code that generates the status hyperlabel: it will create a error description based on the GenCode only and will not include the textual description. That means that you will only get a description like 'Open Error', 'Read Error' etc. To see the real cause of the problem you can override the following method in your DbServer subclass (the italic text is added)

 METHOD __GenerateStatusHL( oError ) CLASS MyDBServer

      lErrorFlag := TRUE

      RETURN HyperLabel{ oError:FuncSym,                  ;

      AsString(oError:GenCode),                   ;

      Symbol2String( ClassName(SELF) ) + ": " +   ;

      ErrString(oError:gencode)+": "+oError:Description + ;

      iif(oError:OSCode!=0,":"+DosErrString(oError:OSCode),"") }