mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 06:47:53 +02:00
Pas2JS: showException with stack trace for RTL Exception object
This commit is contained in:
parent
63a2a4d9e7
commit
96cb3b01de
8
utils/pas2js/dist/rtl.js
vendored
8
utils/pas2js/dist/rtl.js
vendored
@ -155,7 +155,13 @@ var rtl = {
|
||||
},
|
||||
|
||||
showException : function (re) {
|
||||
var errStack = (re.hasOwnProperty('stack')) ? re.stack : re;
|
||||
var errStack="";
|
||||
if (rtl.isObject(re) && re.hasOwnProperty('FJSError') && rtl.isObject(re.FJSError) && !(re.FJSError.stack==undefined)) // rtl Exception
|
||||
errStack=re.FJSError.stack
|
||||
else if (rtl.isObject(re) && re.hasOwnProperty('stack') && !(re.stack==undefined)) // native JS Error
|
||||
errStack=re.stack
|
||||
else
|
||||
errStack=re; // unknown object
|
||||
var errMsg = rtl.hasString(re.$classname) ? re.$classname : '';
|
||||
errMsg += ((errMsg) ? ': ' : '') + (re.hasOwnProperty('fMessage') ? re.fMessage : '');
|
||||
errMsg += ((errMsg) ? "\n" : '') + errStack;
|
||||
|
Loading…
Reference in New Issue
Block a user