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

Default error template prevents captureError #105

Open
roschaefer opened this issue Nov 14, 2017 · 4 comments
Open

Default error template prevents captureError #105

roschaefer opened this issue Nov 14, 2017 · 4 comments

Comments

@roschaefer
Copy link

It took me quite some time to find out why no errors were sent to sentry. It's the default error template.

Minimal working example:

# app/routes/index.js
import Ember from 'ember';

export default Ember.Route.extend({
  model() {
    throw 'aaaaahhhrgh!';
  }
});
<!-- app/templates/error.hbs -->
<div class="ui center aligned container">
        <i class="massive meh icon"></i>
        <div class="ui huge header">Oops</div>
        <p>Hm, something went wrong</p>
        {{outline}}
</div>
@roschaefer
Copy link
Author

And here is the workaround:

// app/routes/application.js
import Ember from 'ember';

export default Ember.Route.extend({

  raven: Ember.inject.service(),
...
  actions: {
    error(error){
      this.get('raven').captureException(error)
      return true; // Let the route above this handle the error.
    }
  }
});

See: https://guides.emberjs.com/v2.16.0/routing/loading-and-error-substates/

Can we have this documented? Or is there a way for ember-cli-sentry to hook into Ember's default error handling? Thoughts?

roschaefer pushed a commit to roschaefer/rundfunk-mitbestimmen that referenced this issue Nov 14, 2017
roschaefer pushed a commit to roschaefer/rundfunk-mitbestimmen that referenced this issue Nov 14, 2017
roschaefer pushed a commit to roschaefer/rundfunk-mitbestimmen that referenced this issue Nov 14, 2017
@sebastianhelbig
Copy link

sebastianhelbig commented Nov 26, 2017

Same problem here. Using error templates seems to be quite normal.

How to get this working? With the proposed workaround my app hangs on the loading template and does not show the error template anymore. (I just did not get the error template because raven was not initialized properly)

@Turbo87
Copy link
Collaborator

Turbo87 commented Dec 29, 2017

Can we have this documented?

yes, I think this should be documented. PRs are obviously welcome 😉

@devinrhode2
Copy link

This should definitely be included in the addon, at least a note in the README to add this

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

No branches or pull requests

4 participants