cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

Error message to be shown when formatting Error #446

Open Feasul opened 9 years ago

Feasul commented 9 years ago

In case an Error to be formatted has a message, add it on top of the error stack. Sometimes error message is more useful than error stack, which is oftentimes doesn't have anything except when.js methods chain.

sompylasar commented 9 years ago

@Feasul Usually the stack's first line contains the error name and the message. In which environments this is not the case?

Feasul commented 9 years ago

@sompylasar I was observing that behavior under iOS 8 WebView. Though you are right, turns out there's no constant behavior among the different environments. I did a quick check on Firefox, Chrome, Safari (Mac) and IE(Win) and only Chrome and IE have error message in stack trace. This patch is obviously unacceptable until it accounts for all the possibilities there are.

briancavalier commented 9 years ago

@Feasul Yeah, unfortunately, there's very little consistency for stack traces across envs. We do the best we can without bloating the code too much. If you can find a way to bring the iOS error reporting in line with the other envs without too much added code, we'd love to have your PR :)

briancavalier commented 9 years ago

Ping @Feasul. Are you still interested in investigating ways to cover all the possible cases, or should we close this?