mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
c24ea5d0bc
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 |
||
---|---|---|
.. | ||
authenticators | ||
components | ||
controllers | ||
helpers | ||
mixins | ||
models | ||
serializers | ||
services | ||
transforms | ||
utils | ||
validators | ||
.gitkeep |