Ghost/ghost/admin/tests/unit
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
..
authenticators Made session.user a synchronous property rather than a promise 2021-07-08 14:54:31 +01:00
components Update dependency ember-mocha to v0.16.0 2019-06-17 15:32:09 +01:00
controllers Ran ember-cli-update --run-codemods (#2219) 2022-01-21 19:25:47 +00:00
helpers Switched members table to show info from most-recently-updated subscription instead of first in array 2022-03-04 16:32:41 +00:00
mixins Update dependency eslint-plugin-ghost to v1.4.0 2020-05-06 18:07:01 +01:00
models Ran ember-cli-update --run-codemods (#2219) 2022-01-21 19:25:47 +00:00
serializers Switched from v3 to canary API 2021-02-05 09:12:26 +00:00
services Fixed raw JS error messages appearing in alerts (#2407) 2022-05-27 11:52:39 +01:00
transforms Refactored to use individual slack settings (#2384) 2022-05-16 11:38:32 +01:00
utils Migrate to latest ember, ember-mocha and modern ember testing (#1044) 2019-01-02 09:58:55 +00:00
validators Refactored to use individual slack settings (#2384) 2022-05-16 11:38:32 +01:00
.gitkeep Ember init, bower deps, es6 modules 2015-03-11 12:37:41 -06:00