{"action":"created","issue":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/698","labels_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/698/labels{/name}","comments_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/698/comments","events_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/698/events","html_url":"https://github.com/petkaantonov/bluebird/issues/698","id":94183711,"number":698,"title":"longStackTraces only includes lines starting with \"at\"","user":{"login":"aaronyo","id":196432,"avatar_url":"https://avatars.githubusercontent.com/u/196432?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronyo","html_url":"https://github.com/aaronyo","followers_url":"https://api.github.com/users/aaronyo/followers","following_url":"https://api.github.com/users/aaronyo/following{/other_user}","gists_url":"https://api.github.com/users/aaronyo/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronyo/subscriptions","organizations_url":"https://api.github.com/users/aaronyo/orgs","repos_url":"https://api.github.com/users/aaronyo/repos","events_url":"https://api.github.com/users/aaronyo/events{/privacy}","received_events_url":"https://api.github.com/users/aaronyo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-10T00:41:36Z","updated_at":"2015-07-13T17:09:45Z","closed_at":"2015-07-10T12:12:28Z","body":"When longStackTraces are enabled, only lines that start with \"at\" are included in each event's trace, at least on V8.  Here's the regexp from captured_trace.js that does this filtering:\r\n\r\n```js\r\n    var v8stackFramePattern = /^\\s*at\\s*/;\r\n```\r\n\r\nI've been doing my own manipulation of stack traces, adding lines starting with \"Caused by: ...\", to represent nested errors.  Those \"Caused by\" lines get thrown out.\r\n\r\nI'm sure there's some good reason for filtering the lines in some way.  If someone could provide more background, I can try to come up with a fix that makes Promise.longStackTraces() play nicely with other manipulations of error.stack."},"comment":{"url":"https://api.github.com/repos/petkaantonov/bluebird/issues/comments/120995424","html_url":"https://github.com/petkaantonov/bluebird/issues/698#issuecomment-120995424","issue_url":"https://api.github.com/repos/petkaantonov/bluebird/issues/698","id":120995424,"user":{"login":"benjamingr","id":1315533,"avatar_url":"https://avatars.githubusercontent.com/u/1315533?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamingr","html_url":"https://github.com/benjamingr","followers_url":"https://api.github.com/users/benjamingr/followers","following_url":"https://api.github.com/users/benjamingr/following{/other_user}","gists_url":"https://api.github.com/users/benjamingr/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamingr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamingr/subscriptions","organizations_url":"https://api.github.com/users/benjamingr/orgs","repos_url":"https://api.github.com/users/benjamingr/repos","events_url":"https://api.github.com/users/benjamingr/events{/privacy}","received_events_url":"https://api.github.com/users/benjamingr/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T17:09:45Z","updated_at":"2015-07-13T17:09:45Z","body":"@aaronyo well, what I do is instead of relying on the a mutated stack is throw meaningful `Error`s and attach properties to them as I go, that way in the final `catch` I can extract everything I need for them (some of my error types have as much as 4 different stages attaching properties and useful information to them. You can also augment `error.message` IIRC.\r\n\r\n```js\r\nPromise.reject(new Error()).\r\ncatch(e => {e.foo = 1; throw e; }).\r\ncatch(e => {e.bar = 2; throw e; }).\r\ncatch(e => {e.baz = \"Hi\"; throw e; }).\r\ncatch(e => {e.causedBy = \"Here\"; throw e; }).\r\ncatch(e => {throw new  SpecifiecException(e)). // innerException like in C#\r\n.catch(e => {\r\n    let {foo, bar, baz, causedBy} = e.inner;\r\n    console.log(foo, bar, baz, causedBy);\r\n})\r\n```\r\n\r\nDoes that solve your problem?"}}