if not (AppNoExceptionMessages in FFlags) then begin // before we do anything, write it down if ExceptObject is Exception then begin if not Skip then begin DebugLn('TApplication.HandleException ',Exception(ExceptObject).Message); DumpExceptionBackTrace; end; end else begin DebugLn('TApplication.HandleException Strange Exception '); DumpExceptionBackTrace; end; end;
procedure TApplication.SetCaptureExceptions(const AValue: boolean);begin if FCaptureExceptions=AValue then exit; FCaptureExceptions:=AValue; if FCaptureExceptions then begin // capture exceptions // store old exceptproc if FOldExceptProc=nil then FOldExceptProc:=ExceptProc; ExceptProc:=@ExceptionOccurred; end else begin // do not capture exceptions if ExceptProc=@ExceptionOccurred then begin // restore old exceptproc ExceptProc:=FOldExceptProc; FOldExceptProc:=nil; end; end;end;