• Resolved karmeljuk

    (@karmeljuk)


    Is it possible to exclude wp-admin issues? Here is an example

    SyntaxError ?(wp-admin/edit)
    Regression
    Unhandled
    Invalid or unexpected token
    
    /wp-admin/edit.php at line 2751:10
    
    {
    from: /wp-admin/edit.php?post_type=shop_order&paged=2, 
    to: /wp-admin/edit.php?post_type=shop_order&paged=2
    }
    

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author stayallive

    (@stayallive)

    Hi!

    I don’t have a snippet for you to just copy and paste over unfortunately but we do have documentation on how to exclude errors from specific parts, this can be easily adjusted to exclude errors from the /wp-admin/.

    > https://github.com/stayallive/wp-sentry#capturing-errors-only-from-certain-theme-andor-plugin

    Take a look to see if you can use that to do what you want!

    Thread Starter karmeljuk

    (@karmeljuk)

    `Hi!

    I don’t have a snippet for you to just copy and paste over unfortunately but we do have documentation on how to exclude errors from specific parts, this can be easily adjusted to exclude errors from the /wp-admin/.

    > https://github.com/stayallive/wp-sentry#capturing-errors-only-from-certain-theme-andor-plugin

    Take a look to see if you can use that to do what you want!`

    Hello Alex
    Thanks for your reply. I already use this filter, but I’m not sure how to modify it for wp-admin. Could you please help me?

    Plugin Author stayallive

    (@stayallive)

    I think replacing this in the snippet from the readme:

    if ( $strContainsHelper( $frame->getFile(), 'themes/THEME_NAME' )
        || $strContainsHelper( $frame->getFile(), 'plugins/PLUGIN_NAME' )
    ) {

    with:

    if ( $strContainsHelper( $frame->getFile(), 'wp-admin/' ) ) {

    might already work, but do be mindful that this excludes any error that comes through wp-admin so also when your code is called from wp-admin it basically looks if the frames (lines of the stacktrace) contains a file from wp-admin and then doesn’t report it. I might be better to simply mark the exceptions you see from the wp-admin as ignored in the Sentry interface or be more specific about which you are filtering because this might filter out too many exceptions.

    So use at your own risk! ??

    • This reply was modified 3 years, 2 months ago by stayallive. Reason: formatting
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude wp-admin issues’ is closed to new replies.