#Understanding expected strings in `ignoreErrors` option

7 messages · Page 1 of 1 (latest)

hushed dew
#

I'm trying to prevent a couple of errors from being sent to Sentry, so I'm using the ignoreErrors option. However, it doesn't seem to be working as I expected. Here's my setting:

// rest of settings object
  ignoreErrors: [
    'AudioFocusNotAcquiredException',
    'Payment is Cancelled',
    'UiConfirmCanceledError'
  ]
}

Yet, I'm seeing this error being logged:

Error: expo.modules.av.AudioFocusNotAcquiredException: Audio focus could not be acquired from the OS at this time.

My impression based on the documentation is that "When using strings, partial matches will be filtered out.", i.e that having "AudioFocusNotAcquiredException" as a string in the options array for ignoreErrors would mean that the error would be filtered out since it contains that string.

Did I misunderstand how to use this?

rain root
#

your understanding of the feature is correct.
can you check in Sentry if expo.modules.av.AudioFocusNotAcquiredException is part of the error message or type?
You can also try one of the following options:

// rest of settings object
  ignoreErrors: [
    'Audio focus could not be acquired',
    /.*AudioFocusNotAcquiredException.*/ 
  ]
}
hushed dew
#

hmm, this is odd. It does seem like it works, but Sentry is grouping together two seemingly different (but related) errors. When I look at "all events", AudioFocusNotAcquiredException has stopped after the released where I started ignoring it, but the other one has not (which is expected).

#

(note, "AudioFocusNotAcquiredException" is ignored since v1.6.1)

#

When I check "merged issues" it doesn't seem to be merged

#

So I'm not sure why these two are considered one and the same

#

i.e. "Player does not exists" and the other one