You are not logged in.
Hi, (Rio10.3.3 ent, mormot latest)
we noticed that when we implement exception in service call that returned
parameters are not properly returned. Is this intentional?
TAllParkHTTPResponeType = (
response_OK,
response_InvalidDeviceID,
response_DeviceTimeout,
...
);
...
procedure SomeCallWithExceptionInside(const DeviceID: integer;out Park: TParkingsArray; out Err:TAllParkHTTPResponeType);
Err is internally set before exception, but on the client side's out Err value is wrong.
thank you,
Vojko Cendak
Last edited by VojkoCendak (2020-02-04 13:31:55)
Offline
Exceptions should be trapped on the server side, and the error code should be explicitly set in the "except" block.
Offline
Thank you,
The exception is generated serverside and trapped on clientside:
server side:
procedure TSomeService.myProcWithException(... ; out Err:TSomeEnum);
begin
...
...
if SomeCondition then begin
Err := MyValueForError; //==> here I set it serverside, but it's value isn't transmitted to client(it stays default enum) !
Raise Exception.Create('my error message'); //==>
end;
end;
client side:
try
...
RestSvc.myProcWithException(...., Err); //== here exception happens, but Err is not valid
...
except on E: Exception do begin
ReportErrorValue := Err; // here err is not valid !
end;
end;
Question is whether out parameter Err should be transitted as set on server side in
case of exception.
Thank you, Vojko
Offline