Ghost/ghost/admin/tests/unit/services
Kevin Ansfield c24ea5d0bc Fixed raw JS error messages appearing in alerts (#2407)
refs https://github.com/TryGhost/Team/issues/1613

We use `notifications.showAPIError()` in many of our try/catch routines but those can also pick up standard JS errors which can result in ugly and useless messages showing in alerts.

- added a list of known built-in JS error type names to check against and a generic error message to be used in place of ones we know shouldn't be displayed
- in `showAPIError(obj)` check `obj.name` against the known list and swap the message for a generic one
  - only the message is swapped, we still log the full/original error to Sentry
- in `handleNotification(msg)` which is the final method used when displaying any alert/notification, extract all words in the supplied message and check that against the known list and swap the message on a match. This handles situations where the API might give us a raw JS error message in the message string
2022-05-27 11:52:39 +01:00
..
event-bus-test.js Update ember core 2019-07-22 14:00:52 +01:00
limit-test.js Added integration with limit service 2021-04-08 16:59:56 +12:00
member-stats-test.js 🐛 Fixed incorrect MRR value on dashboard 2021-08-09 17:47:09 +05:30
notifications-test.js Fixed raw JS error messages appearing in alerts (#2407) 2022-05-27 11:52:39 +01:00
unsplash-test.js Ran ember-cli-update --run-codemods (#2219) 2022-01-21 19:25:47 +00:00