Application.OnException := self.doException;
procedure TForm1.doException(Sender: TObject; E: Exception); var sError: string; begin sError := '应用程序级异常,描述=' + E.Message; try //在此处理 except end; end;