-
-
Notifications
You must be signed in to change notification settings - Fork 135
sentry context not found on active domain #305
Comments
Definitely.
Yep.
Unfortunately no current facility for this, but seems reasonable for advanced use cases. I'll think about how to best do something like this. Out of curiosity, could you share some more details on your use case/what you're already using a domain for, and how promises are fitting into this picture? |
I have written my own framework called The promises are just used throughout the application to run asynchronous code. But it the past when using domains and promises i have had issue where you would not reenter a domain when the |
Makes sense, pretty similar to how we do contexts in Raven.
Yep, classic.
Out of the box this situation hasn't changed significantly AFAIK, but yea, bluebird generally solves it. We've had some discussion on that in #265. Our I don't know exactly what your domain-based error capturing you mentioned looks like, but what I can recommend trying based on assumptive/educated guesses:
Our var wrapDomain = domain.create();
wrapDomain.sentryContext = { ... };
wrapDomain.on('error', next);
wrapDomain.run(next); Much simplified, but that's the core of it, to give you an idea of what's going on under its covers. It should be pretty straightforward to replicate that portion of its job in your existing domain error catching stuff, assuming that you have that set up along the lines of what I'm imagining. |
Sounds good, I will try it when i have a chance. |
@LewisJEllis - I see this error in our logs. We are using pm2 and haven't used domains. What might be the issue here? |
Any update on this? |
I have a lot of errors not being reported. I am getting
raven@1.2.1 alert: sentry context not found on active domain
and no errors in the dashboard.I think this has to do with nesting domains. My application already has a domain and requests go through it. In the middle i inject the
requestHandler
to get the sentryContext, but i then get these messages instead of the errors. It would be nice if i can attach a sentry context to my current domain instead of nesting them. When i looks at the active domain it sometimes has the sentryContext, but because of the way promises and domains don't play nice together i think it has trouble selecting the correct active domain during an error.The text was updated successfully, but these errors were encountered: