catchException
Versión Estable
This is a VFP class that aims to capture exceptions and record them in a log and, if necessary, relaunch them at a higher level.
None! There is no dependency!
git clone https://github.com/raulvfp/catchException.git catchException
Properties:
Methods:
1st - This example does not relaunch the exception at a higher level, but controls it in the catch block
bRelanzarThrow = .F. &&NO Relanza la excepcion.
TRY
*--- Este es una excepcion generada con THROW
THROW lcExpectedValue
CATCH TO loEx
loTmp = CREATEOBJECT('catchException', bRelanzarThrow)
THIS.MessageOut('Esto me indica si es un error o algo generador por el programador: ' +loEx.Message)
THIS.MessageOut('Valor de userValue: '+loEx.UserValue)
ENDTRY
2nd - This example the exception is thrown to a higher level for control
bRelanzarThrow = .T. &&Relanza la excepcion al nivel superior.
TRY
*--- Este es una excepcion generada con THROW
THROW lcExpectedValue
CATCH TO loEx
loTmp = CREATEOBJECT('catchException', bRelanzarThrow)
*-- No se ejecuta nada despues del CREATEOBJECT('catchException')
ENDTRY