One way would be to define an Event in the library, with information about the exception and intercept it from your core app. Something like:
Code: Select all
// in a VO dialect library:
DELEGATE ErrorHappenedDelegate(oError AS Exception) AS VOID
STATIC CLASS ErrorHandler
STATIC EVENT ErrorHappened AS ErrorHappenedDelegate
STATIC METHOD RaiseError(oError AS Exception) AS VOID
IF ErrorHandler.ErrorHappened != NULL
ErrorHandler.ErrorHappened(oError)
END IF
STATIC METHOD LinkErrorBlock() AS VOID
ErrorBlock({|oError| ErrorHandler.RaiseError(oError)})
END CLASS
Code: Select all
// in the main core app:
ErrorHandler.ErrorHappened += MyErrorHandler
PROCEDURE MyErrorHandler(oError AS Exception)
? oError:ToString()