briancavalier/wire — Issue #13: Trace With Actual Exception Not Logged
Author: lightsblue
Created: 2011-12-29 19:37:18+00:00
State: open

I have an error in tv.js line 292. It's called from an init facet in my wire spec.

[Here's a screenshot of my chrome console](http://cl.ly/190O1E1M0O1E3o3O2I3h) after the error is thrown (you'll want to zoom in).

You can see the first error is the one that was automatically generated by wire. Not helpful in this situation as it says nothing about line 292 in tv.js, and actually doesn't even print the error message.

Looking at the code in debug.js:

```javascript
// TODO: Consider using stacktrace.js
// https://github.com/eriwen/javascript-stacktrace
// For now, quick and dirty, based on how stacktrace.js chooses the appropriate field
// If console.trace exists, use it, otherwise use console.error
logStack = typeof console.trace == 'function'
? function (e) { console.trace(e); }
: function (e) { console.error(e.stack || e.stacktrace || e.message || e); };
```

In my screenshot I manually executed both options for comparison. You can see that unhelpful option 1 is being chosen based on my chrome environment. In my case I really want e.stack to be called so I get a pointer to tv.js line 292.