0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Added 403 errors to the error handler (#21898)

ref ENG-745

- added permission related errors to list of error types to be handled
- previously, generic error messages were displayed when permission
errors are thrown
- this would make it possible to display the actual message returned
from the API in toasts
This commit is contained in:
Sodbileg Gansukh 2024-12-17 18:21:48 +08:00 committed by GitHub
parent 4ec0bdde3c
commit 65bec88187
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,6 +20,8 @@ const handleResponse = async (response: Response) => {
throw new VersionMismatchError(response, data);
} else if (data.errors?.[0]?.type === 'ValidationError') {
throw new ValidationError(response, data);
} else if (data.errors?.[0]?.type === 'NoPermissionError') {
throw new ValidationError(response, data);
} else if (data.errors?.[0]?.type === 'ThemeValidationError') {
throw new ThemeValidationError(response, data);
} else if (data.errors?.[0]?.type === 'HostLimitError') {