04-16-2021, 10:36 PM
Hi, see this demo:
https://github.com/Atozed/IntraWeb/blob/...roller.pas
https://github.com/Atozed/IntraWeb/blob/...roller.pas
Code:
class function TIWExceptionRendererEx.RenderHTML(AException: Exception;
ARequest: THttpRequest): string;
var
Addr: string;
begin
// the goal here is to respond to a session timeout error with a HTML with your address
if AException is EInvalidSession then begin
Addr := #39 + 'https://especificURL.com' + #39; // start address enclosed in single quotes
Result := '<!DOCTYPE html>' +
'<html>' +
'<head>' +
'<script type="text/javascript">' +
'setTimeout("window.location=' + Addr + '", 1);' +
'</script>' +
'</head>' +
'<body>' +
'</body>' +
'</html>';
end
else
Result := inherited;
end;