Hi,
You can set server.SendExceptionsAs500 to False
.
In this case, you will receive exception message
if you like to customize this error, you can
- create and use your own descendant of TROHttpApiDispatcher. Put try/except to Process method like
procedure TMyHttpApiDispatcher.Process(aTransport: IROHTTPTransport; aRequest: IROHTTPRequest;
aResponse: IROHTTPResponse; aRequestData, aResponseData: TStream);
begin
try
inherited;
except
// <<<<<< customize the response? i.e. aResponse/aResponseData
end;
end;
- customize the response in server.OnCustomResponseEvent event. You can use it similar to
v2
as in Delphi DA REST server versioning with code-first server thread