LogSistemas01 Posted May 5, 2020 Posted May 5, 2020 Folks, at VCL, I did exception handling with TApplicationEvents.OnException All exceptions burst in this routine, I treated the way to display the message according to the type of exception, if it was a controlled exception, it shows a simple message, if not, it shows some other details. Is it possible to do this centralization of exception in Unigui? Through applicationevents it was not possible. Quote
Mehmet Emin Posted May 5, 2020 Posted May 5, 2020 There is an event in servermodule may be it can help you (I have never used it). procedure TUniServerModule.UniGUIServerModuleException( Sender: TUniGUIMainModule; AException: Exception; var Handled: Boolean); Quote
LogSistemas01 Posted May 6, 2020 Author Posted May 6, 2020 On 5/5/2020 at 12:22 PM, Mehmet Emin said: There is an event in servermodule may be it can help you (I have never used it). procedure TUniServerModule.UniGUIServerModuleException( Sender: TUniGUIMainModule; AException: Exception; var Handled: Boolean); Thanks, I will try. Quote
Mehmet Emin Posted May 19, 2020 Posted May 19, 2020 Also if you decide to use madExcept for bug reporting you can find the below code useful. procedure TUniServerModule.UniGUIServerModuleException( Sender: TUniGUIMainModule; AException: Exception; var Handled: Boolean); var CurSession : TUniGUISession; begin if not (AException is EAbort) then begin if not (AException is UniErrorException) and not (AException is EUniSessionException) then begin CurSession := UniSession; if Assigned(CurSession) then CurSession.AlertDisabled := True; try AutoSaveBugReport(CreateBugReport(etNormal, nil, nil, 0, 0, 0, nil, false)); Handled := True; finally if Assigned(CurSession) then CurSession.AlertDisabled := False; end; end; end; end; Quote
LogSistemas01 Posted May 19, 2020 Author Posted May 19, 2020 I'd like you conditionals. I dont know if i will use madexcept, but thanks! Based on my tests, assigning True to Handled, the standard unigui warning of the error is not displayed, What would it be AlertDisabled := True; thanks! Quote
Mehmet Emin Posted May 19, 2020 Posted May 19, 2020 Since there is no source code available for TUniGUISession and no documentation of this property except a usage in a demo for UniGUIAuxExceptionHandler with Eureka I looked at that code and thougth that if Farshad Mohajeri put this line here there should be a reason. I could not see a difference in my case but I keep it there anyway. I think it is there to disable web user feed with dumps etc. in case something goes wrong (I dont see any different). 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.