Exception log |
Pas2JS pascal source code
procedure LogException(sender: TObject; AException: Exception; Value: string); begin WriteLn(AException.Message); WriteLn(Value); end; var x: Integer; try x := 2012; if x > 2000 then raise Exception.Create('something went wrong'); except on E: Exception do LogException(NIL, E, 'woops!'); end; { <<< CONSOLE OUTPUTS >>> something went wrong woops! }