* Allow to log message on create, so event handler exceptions can be traced in debugger console

This commit is contained in:
michael 2019-10-18 08:01:02 +00:00
parent 848ea3e0bf
commit d7d47e1439

View File

@ -64,6 +64,9 @@ type
FNodeJSError: TJSError;
{$endif}
public
class var
LogMessageOnCreate : Boolean;
Public
constructor Create(const Msg: String); reintroduce;
constructor CreateFmt(const Msg: string; const Args: array of jsvalue);
constructor CreateHelp(const Msg: String; AHelpContext: Integer);
@ -2107,6 +2110,8 @@ begin
{$ifdef nodejs}
FNodeJSError:=TJSError.new;
{$endif}
if LogMessageOnCreate then
Writeln('Created exception ',ClassName,' with message: ',Msg);
end;
constructor Exception.CreateFmt(const Msg: string; const Args: array of jsvalue