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

Exceptions in/before app route init hook are not reported #164

Open
devinrhode2 opened this issue Oct 4, 2018 · 7 comments
Open

Exceptions in/before app route init hook are not reported #164

devinrhode2 opened this issue Oct 4, 2018 · 7 comments

Comments

@devinrhode2
Copy link

If I try calling captureException in or before the application route init hook, before isRavenUsable becomes true, the error will not be reported to sentry. I'll need to store calls in a que in my logging service, and then flush the que once isRavenUsable becomes true. I tried observing isRavenUsable, but that is not firing. I am not too sure what to do other than not use this addon, or try and fix this addon, but not sure where I'd start for that.. when exactly is raven setup?

@devinrhode2 devinrhode2 changed the title No reporting in/before app route init hook (before isRavenUsable) No reporting exceptions in/before app route init hook (before isRavenUsable) Oct 4, 2018
@devinrhode2
Copy link
Author

Basically, sentry should be the first thing that's loaded in the app, to make sure any issues loading are identified

@Turbo87
Copy link
Collaborator

Turbo87 commented Oct 5, 2018

While I agree in theory, this is somewhat hard to achieve since the service and the config are only available after the app has booted.

@devinrhode2
Copy link
Author

I'm going to try hacking around with putting this addon's code in app.js... maybe just transform my service into a global wrapper around raven/sentry... although the most bulletproof way to handle this is load raven from the cdn, (in case there's an issue loading our app code), and then I guess in the index.html, put configuration/initialization stuff...

@devinrhode2
Copy link
Author

What do you think is the best way to go about this @Turbo87?

@Turbo87
Copy link
Collaborator

Turbo87 commented Oct 5, 2018

I don't know, I'm on vacation right now. Will think about it when I get back :)

@devinrhode2 devinrhode2 changed the title No reporting exceptions in/before app route init hook (before isRavenUsable) Exceptions in/before app route init hook are not reported Oct 11, 2018
@devinrhode2
Copy link
Author

devinrhode2 commented Oct 11, 2018

While I started to screw around with putting the ravenjs cdn tags in the index.html and then considered forking this addon and making it reference the global window.Raven, it seems the best thing to do is to just set a few things up manually according to these instructions in the readme for ember-cli-deploy-sentry: https://github.com/dschmidt/ember-cli-deploy-sentry#manual-integration-with-raven-js

At the end of the day I don't understand why this addon can't run before app.js starts. Or at the very least, add an initialization hook could be called inside app.js to get things booted+configured properly, before any custom application logic executes. (Could even pass in the config, which I think is imported in app.js by default)

(psssst: resources failing to load prior to this point in app.js will not necessarily be detected, if you need to detect resources failing to load and try re-loading any css+js files, lmk I'd be happy to work with you in some capacity)

I think something could be inserted into the index.html's {{content-for 'head'}} hook, and then this could even detect resources failing to load, and try loading them again.

@Turbo87
Copy link
Collaborator

Turbo87 commented Oct 12, 2018

using the CDN makes an additional HTTP request and makes your app depend on a third-party server. for some users this is not an option, so we explicitly removed that option in one of the last releases. most of the time it's a lot easier to just bundle the most recent version of their client in your vendor.js file

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

2 participants