Jump to content
Stuart Clennett

Server.Ignition.pas(86): E2010 Incompatible types: 'TBeforeHandleRequestProc' and 'Procedure'

Recommended Posts

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 by Stuart Clennett
incorrectly stated mars version as 10.4 instead of 1.4

Share this post


Link to post

FIXED.

 

The function signature now uses IMARSResponse and IMARSRequest from MARS.Core.ResponseAndRequest.Interfaces

D'oh 🙂 

 

Share this post


Link to post

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

 

 

  • Like 1

Share this post


Link to post

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 by Stuart Clennett

Share this post


Link to post
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

  • Like 1

Share this post


Link to post
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. 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×