Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new event 'page:error' #2884

Closed
chrisbreiding opened this issue Dec 3, 2018 · 4 comments
Closed

Add new event 'page:error' #2884

chrisbreiding opened this issue Dec 3, 2018 · 4 comments
Assignees
Labels
stage: ready for work The issue is reproducible and in scope type: breaking change Requires a new major release version
Milestone

Comments

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Dec 3, 2018

This will replace the current 'uncaught:exception' event, which is equivalent to when window.onerror fires. It will also fire when window.onunhandledrejection fires.

It's called signature should be:

cy.on('page:error', (error, runnable) => {}

We'll add a source property to indicate where it came from ('onerror' or 'unhandledrejection').

The user can return false to not handle the error.

We'll standardize the error from window.unhandledrejection, so that there's no reason property.

@chrisbreiding chrisbreiding added this to the Sprint 14 milestone Dec 3, 2018
@chrisbreiding chrisbreiding self-assigned this Dec 3, 2018
@jennifer-shehane
Copy link
Member

Will this be a breaking change? I know a lot of users have the uncaught:exception event listener in their test code.

@chrisbreiding chrisbreiding added the type: breaking change Requires a new major release version label Dec 4, 2018
@chrisbreiding
Copy link
Contributor Author

Yes, it will.

@jennifer-shehane
Copy link
Member

@chrisbreiding Will this address this issue of listening to onerror on different subdomain? #3750

@jennifer-shehane
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: ready for work The issue is reproducible and in scope type: breaking change Requires a new major release version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants