[fpc-devel] procedure ShowException

Ondrej Pokorny lazarus at kluug.net
Fri Jun 1 21:14:29 CEST 2018


Hello,

is there any reason the OnShowException event is ignored for console 
applications?

Why not so:

procedure ShowException(ExceptObject: TObject; ExceptAddr: Pointer);
// use shortstring. On exception, the heap may be corrupt.
Var
   Buf : ShortString;
begin
SetLength(Buf,ExceptionErrorMessage(ExceptObject,ExceptAddr, at Buf[1],255));
   If Assigned(OnShowException) Then
     OnShowException (Buf)
   Else
   If IsConsole Then
     writeln(Buf)
end;

?

Ondrej




More information about the fpc-devel mailing list