Skip to content

Commit 8be65da

Browse files
committed
fixes gautamsi#167
1 parent 16b474f commit 8be65da

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/js/Exceptions/Exception.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ export class Exception {//} extends Error { //ref: can not extend from Error. Ty
3737
* @override user JSON.stringify for now, todo: impelemtn real Exception tostring
3838
*/
3939
toString() {
40-
return JSON.stringify(this);
40+
let result = this.stack;
41+
try {
42+
result = result || JSON.stringify(this);
43+
}
44+
catch (e) { }
45+
46+
return result;
47+
}
48+
ToString() {
49+
return this.toString();
4150
}
4251
}

0 commit comments

Comments
 (0)