Skip to content

Break-on-exception doesn't work for forked promises #3

@rogueg

Description

@rogueg

Chrome's break-on-exception doesn't always break when exceptions are thrown in a promise callback.

it('confuses me', () => {
  let start = new Promise(r => setTimeout(r, 10))
  let forked = delay.then(() => { throw "huh" })
  return wantBroken ? forked : start
})

Returning start works fine, but returning forked won't break (but it does print to the console). If you add a catch block to runTest, it catches the error, so it's not like the promise is just swallowing it.

I've also noticed that bluebird promises don't have this issue. The problem with bluebird is that stack traces are very wrong (even with longStackTrace on).

I think the ideal would be to figure out how bluebird does it, and replicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions