I implemented:
window.onerror = function (m, s, l, c, e) {
}
Where the e is the Error Object. For example, it contains:
ReferenceError: rde is not defined
at Object.bla.cs (domain.pt/bla.js:418:17)
at n.aanv (domain.pt/bla.js:125:29)
If i make e.toString()
, only the first line is returned. How to get the 3 lines? Thank you.
Error object have a .message
property containing the full message (no need for .toString()
. There is also .stack
but it's not a standardized property.