{"id":17357870,"date":"2024-01-19T18:06:20","date_gmt":"2024-01-19T18:06:20","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/filter-errors\/"},"modified":"2024-01-19T19:40:49","modified_gmt":"2024-01-19T19:40:49","slug":"filter-errors","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/filter-errors\/","title":{"rendered":"Filter errors"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;d like to ignore all the errors on the site and keep only the errors in my theme and plugin. So I tried your code: <a href=\"https:\/\/github.com\/stayallive\/wp-sentry\/tree\/v7.3.1?tab=readme-ov-file#capturing-errors-only-from-certain-theme-andor-plugin\">https:\/\/github.com\/stayallive\/wp-sentry\/tree\/v7.3.1?tab=readme-ov-file#capturing-errors-only-from-certain-theme-andor-plugin<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br \/>Which didn&#8217;t really work as I&#8217;d hoped.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">So I tried to check whether the filter worked like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'wp_sentry_options', function ( \\Sentry\\Options $options ) {\n    $options-&gt;setBeforeSendCallback( function ( \\Sentry\\Event $event ) {\n        error_log( \"DEBUG SENTRY : HOOK\" );\n        return null;\n    } );\n\n    return $options;\n} );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If I&#8217;m not too stupid, it shouldn&#8217;t log any errors in Sentry. However, most of them are ignored, but not all: https:\/\/prnt.sc\/IsOC-DmjsSyM<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How do you explain this?<\/p>\n","protected":false},"template":"","class_list":["post-17357870","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17357870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17357870\/revisions"}],"predecessor-version":[{"id":17357874,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17357870\/revisions\/17357874"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17357870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}