Updated showAlert to send only errors to sentry

refs: https://github.com/TryGhost/Team/issues/1121

- Reviewing the list of errors in sentry, some of the most common ones are:
   - success messages like "Password changed"
   - info messages like "Please check your email for instructions."
   - warnings like "You need to sign out to register as a new user."
- None of these are errors, so they shouldn't appear in sentry
This commit is contained in:
Hannah Wolfe 2022-09-07 13:42:28 +01:00
parent b377390855
commit 0ad501ec4b

View File

@ -94,7 +94,7 @@ export default class NotificationsService extends Service {
showAlert(message, options = {}) {
options = options || {};
if (!options.isApiError) {
if (!options.isApiError && (!options.type || options.type === 'error')) {
if (this.config.get('sentry_dsn')) {
// message could be a htmlSafe object rather than a string
const displayedMessage = message.string || message;