born05 / craft-sentry

Pushes Craft CMS errors to Sentry.
MIT License
10 stars 11 forks source link

Access getLastEventID method #11

Open codyjames opened 3 years ago

codyjames commented 3 years ago

I'm trying to figure out how to implement this: https://docs.sentry.io/platforms/php/enriching-events/user-feedback/ but need to get access to the getLastEventID method. Is that accessible via this plugin?

Let me know. Thanks!

roelvanhintum commented 3 years ago

Currently not, but you could access it via custom module's variable class. This has to be used from a template right? Sentry is accessible anywhere you use Sentry;. :)

roelvanhintum commented 3 years ago

@codyjames, sorry for the late response. Sentry\State\Hub::getCurrent()->getLastEventId(); doesn't seem to work. Maybe outdated docs? I'd be happy to make this available from the plugin itself, but I cannot get getLastEventId to work.

codyjames commented 3 years ago

Right, I tried a similar approach but was not successful either. Not a big deal for me right now.

roelvanhintum commented 3 years ago

@codyjames does Sentry\State\HubAdapter::getInstance()->getLastEventId() work for you? I didn't get a result, but at least no errors.

codyjames commented 3 years ago

No, it did not work.