Problems using error object
Posted: Mon Oct 02, 2017 8:50 am
I have the following constructi:
bSaveErrorBlock := ErrorBlock( {|e| Break(e) } )
BEGIN SEQUENCE
DO WHILE !EOF()
SOME CODE
SKIP
ENDDO
RECOVER USING oError
WTF oError pause
wtf('Arguments: '+dc_xtoc(oError:arguments)) pause
wtf('Cargo: '+dc_xtoc(oError:arguments)) pause
wtf('Error description: '+dc_xtoc(oError:description)) pause
wtf('Gencode: '+dc_xtoc(oError:gencode)) pause
wtf('Operation: '+dc_xtoc(oError:operation)) pause
wtf('OSCode: '+dc_xtoc(oError:oscode)) pause
LB_Warning({'Arguments: '+dc_xtoc(oError:arguments), ;
'Cargo: '+dc_xtoc(oError:arguments), ;
'Error description: '+dc_xtoc(oError:description), ;
'Gencode: '+dc_xtoc(oError:gencode), ;
'Operation: '+dc_xtoc(oError:operation), ;
'OSCode: '+dc_xtoc(oError:oscode)}, ;
'Error Information')
lOK := .F.
ErrorBlock(bSaveErrorBlock)
END SEQUENCE
The WTF oError pause pauses and lets me browse the error object and I can see the instance variable.
However, when using WTF or LB_Warning (front-end to dc_msgbox()), it does not display anything. What do I need to do in order to display the error object attributes via a user popup or wtf.
Cliff
bSaveErrorBlock := ErrorBlock( {|e| Break(e) } )
BEGIN SEQUENCE
DO WHILE !EOF()
SOME CODE
SKIP
ENDDO
RECOVER USING oError
WTF oError pause
wtf('Arguments: '+dc_xtoc(oError:arguments)) pause
wtf('Cargo: '+dc_xtoc(oError:arguments)) pause
wtf('Error description: '+dc_xtoc(oError:description)) pause
wtf('Gencode: '+dc_xtoc(oError:gencode)) pause
wtf('Operation: '+dc_xtoc(oError:operation)) pause
wtf('OSCode: '+dc_xtoc(oError:oscode)) pause
LB_Warning({'Arguments: '+dc_xtoc(oError:arguments), ;
'Cargo: '+dc_xtoc(oError:arguments), ;
'Error description: '+dc_xtoc(oError:description), ;
'Gencode: '+dc_xtoc(oError:gencode), ;
'Operation: '+dc_xtoc(oError:operation), ;
'OSCode: '+dc_xtoc(oError:oscode)}, ;
'Error Information')
lOK := .F.
ErrorBlock(bSaveErrorBlock)
END SEQUENCE
The WTF oError pause pauses and lets me browse the error object and I can see the instance variable.
However, when using WTF or LB_Warning (front-end to dc_msgbox()), it does not display anything. What do I need to do in order to display the error object attributes via a user popup or wtf.
Cliff