#1 2014-12-22 12:59:28

jaclas
Member
Registered: 2014-09-12
Posts: 215

Server off-line, client raises strange exception

Hi,

When I turn off the server (off-line) and when I call from the client the service registration method:


     CalcClient: TSQLHttpClientWinHTTP;
     [...]
     CalcClient.ServiceRegister ([TypeInfo (ICalculator)], sicShared);

then mORMot mapping connection error to HTML_NOTIMPLEMENTED connection (code 501), why?

w1ho3T1v.png

At a later stage this error is resolved as:

'TServiceFactoryClient.Create (): ICalculator TSQLRestRoutingREST routing interface or not supported by server:'

by this code in TServiceFactoryClient.Create(...) method:

  if not InternalInvoke(SERVICE_PSEUDO_METHOD[imContract],'',@RemoteContract,@Error) then
    raise EServiceException.CreateUTF8('%.Create(): I% interface or % routing not '+
      'supported by server%',[self,fInterfaceURI,fRest.ServicesRouting,Error]);

Why not "connection error"?

--
best regard
Jacek

Offline

#2 2014-12-22 22:01:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,662
Website

Re: Server off-line, client raises strange exception

This was an implementation choice, to ease client side code.

Perhaps the error message may be diverse.

All those errors would IMHO rather be displayed as a generic "impossible to access to the service - please check your connection or your credentials" error, without any technical error.
The technical error message, including the connection error exception message, should be still available as part of the EServiceException message, right?

Offline

Board footer

Powered by FluxBB