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

[Bug] Ember.onerror does not handle exceptions thrown in component action #19053

Closed
skarger opened this issue Jul 22, 2020 · 3 comments
Closed

Comments

@skarger
Copy link

skarger commented Jul 22, 2020

Description

When an action throws an uncaught exception, Ember.onerror does not execute.

As shown by the demo app below, there are several other situations where Ember.onerror does not apply, for Promise rejections in various cases. Those may not be bugs? Overall it's unclear to me what Ember.onerror is supposed to cover and whether using it is a best practice.

Reproduction

https://github.com/skarger/ember-on-error

screenshot

Environment

  • Ember: - 3.19.0
  • Node.js/npm: - 12.14.0
  • OS: - darwin x64
  • Browser: - Tested in Firefox 78.0.2 and Chrome 84.0.4147.89.

Other Context

@skarger skarger changed the title [Bug] Ember.onerror does not handle exceptions thrown from a component action [Bug] Ember.onerror does not handle exceptions thrown in component action Jul 22, 2020
@rwjblue
Copy link
Member

rwjblue commented Jul 22, 2020

Thanks for putting this together! We are chatting through this over in emberjs/ember-qunit#592. This demo app is a good starting point for the evaluation of scenarios that I was mentioning in my recent comments over there.

I'm going to close this issue for now (don't want to bifurcate the conversation), but I fully expect for this to result in some changes here (even if just for API docs).

@rwjblue rwjblue closed this as completed Jul 22, 2020
@helgablazhkun
Copy link

@rwjblue Kindly clarify why the issue is closed? It looks like this issue isn't connected with ember-qunit as Ember.onerror doesn't catch exceptions thrown in ember component action.

@andreyfel
Copy link
Contributor

@rwjblue is it expected that Ember.onerror doesn't catch exceptions from actions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants