Stuart Clennett 15 Posted June 25, 2020 (edited) Hi all, I've upgraded to MARS 1.4 and I'm hitting this compiler error on all my servers - including the MARSTemplate servers: [dcc32 Error] Server.Ignition.pas(86): E2010 Incompatible types: 'TBeforeHandleRequestProc' and 'Procedure' This is in response to the following: FEngine.BeforeHandleRequest := function (const AEngine: TMARSEngine; const AURL: TMARSURL; const ARequest: TWebRequest; const AResponse: TWebResponse; var Handled: Boolean ): Boolean begin Result := True; { code snip } end; which is in class constructor TServerEngine.CreateEngine. I'm not that great with anonymous methods & can't figure this one out. Thanks in advance, Edited June 25, 2020 by Stuart Clennett incorrectly stated mars version as 10.4 instead of 1.4 Share this post Link to post
Stuart Clennett 15 Posted June 25, 2020 FIXED. The function signature now uses IMARSResponse and IMARSRequest from MARS.Core.ResponseAndRequest.Interfaces D'oh 🙂 Share this post Link to post
Andrea Magni 75 Posted June 25, 2020 Hi @Stuart Clennett, my fault! I forgot to update some prototypes here and there. Thanks for pointing this out: add these to the uses clause: , MARS.Core.URL, MARS.Core.RequestAndResponse.Interfaces change the BeforeHandleRequest assignment to : FEngine.BeforeHandleRequest := function (const AEngine: TMARSEngine; const AURL: TMARSURL; const ARequest: IMARSRequest; const AResponse: IMARSResponse; var Handled: Boolean ): Boolean begin Thanks! I'll fixit in the repo ASAP Andrea 1 Share this post Link to post
Stuart Clennett 15 Posted June 25, 2020 (edited) Thanks @Andrea Magni - I spotted the difference immediately after posting my question. Just going through and updating my servers now. Hope you're all safe & well. Edited June 25, 2020 by Stuart Clennett Share this post Link to post
Andrea Magni 75 Posted June 25, 2020 1 hour ago, Stuart Clennett said: Hope you're all safe & well. We are fine thanks! Getting used to the "new normal" and looking ahead hoping things will globally improve soon. I've merged your PR a couple of minutes ago, thanks! 🙂 Andrea 1 Share this post Link to post
Stuart Clennett 15 Posted June 25, 2020 4 minutes ago, Andrea Magni said: We are fine thanks! Getting used to the "new normal" and looking ahead hoping things will globally improve soon. I've merged your PR a couple of minutes ago, thanks! 🙂 Andrea Excellent news & thanks for the merge. 1 Share this post Link to post