PHP: Only capture errors from certain directory / files

Hi there,

I’m using Sentry as part of my WordPress plugin, to capture errors that the plugin may throw up.

Currently, with Sentry instantiated at the beginning (my plugin’s run() function, where everything happens), it is capturing all errors on users’ sites (ie, those not thrown by my plugin, and those thrown by my plugin).

Is there a way to tell Sentry to only capture errors thrown by code “in the current folder, and child folders”, or “From this plugin’s class” ?

I see this, but can’t quite make sense of where things are at (is the PR approved? Or is there already a way to achieve this in the current codebase?).

Thanks!
Lloyd

@joneslloyd – I’d leave a comment or +1 on that PR on GitHub.

Hi @benvinegar - I’ve just done it :slight_smile:

Are you able to confirm, though, whether it’s currently possible? I wasn’t too sure, based on some of the comments.

Cheers

Are you able to confirm, though, whether it’s currently possible?

@joneslloyd – I dug around a bit, and I don’t think so, hence the issue.

Okay got it - Thanks for checking!