Delphi capture screen exception special handling

Application.OnException := BSException;//Exception catch


procedure TfmClient.BSException(Sender: TObject; E: Exception);
begin
  // EOSError System Error. Code: 5. Access is denied.
  .if Pos('System Error.Code: 5.',e.Message) > 0 then abort
    ;
  //Since the form is closed when the data is not fetched, the address of the module will be wrong.
  if Pos('dsnap70.bpl',e.Message) > 0 then
    abort;
  if Pos('Cannot create form. No MDI forms are currently active',e.Message) > 0 then
    halt;
  ShowMessage(e.Message); //Pop up exception message
end;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325495204&siteId=291194637