mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +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 |
||
---|---|---|
.. | ||
event-bus-test.js | ||
limit-test.js | ||
member-stats-test.js | ||
notifications-test.js | ||
unsplash-test.js |