- in the event we get an unknown error bubble up, we don't handle the
templating on the error name
- `@tryghost/tpl` throws an error because we pass an undefined string:
`Cannot read properties of undefined (reading 'replace')`
- this commit adds handling to fallback to a different user message in
that event so we don't cause a 500 error
no issue
Change to error handling caused all theme errors to be reported in Sentry, this fix (and a respective fix in Ghost) allows the error to be prepared for sentry before replacing the stack
refs: https://github.com/TryGhost/Team/issues/1369
If we prepare the error for users to view before using Sentry, then the error passed to Sentry will have the stack trace removed for production environments.
@tryghost/errors@1.2.5 also made it so that the error is not mutated, but cloned and a new one is returned.