Reputation: 1024
I just updated to Google Chrome 43.0.2357.65 and was writing Javascript code made to log errors to the console; something like:
try { ...} // raise some error
catch(e) {console.log(e); ...}
I've used this in the past to log the Error object and inspect its attribute. Now, all I see is a stack trace with no access to the Error object itself. Is this an intended behaviour? Is there any way I can inspect the error object in the console?
Upvotes: 0
Views: 360
Reputation: 26975
I have no idea whether this is intended behaviour, but I have been able to reproduce the difference and a quick fix is to use the console.dir
function. console.dir
is a great function to always shows up on the console as an object, even if you do something like console.dir("a string")
.
Displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects.
Source: https://developer.mozilla.org/en-US/docs/Web/API/Console/dir
Upvotes: 1