From bb17ef2b0230c461e1a4f65716e975fdb94be2ce Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Tue, 31 Oct 2023 13:56:34 +0000 Subject: [PATCH] Handled unhandled ember ajax errors (#18803) no refs Handled unhandled ember ajax errors (i.e `406`) so that a friendly error message can be displayed to the user. --- ghost/admin/app/services/ajax.js | 2 +- ghost/admin/app/services/notifications.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/services/ajax.js b/ghost/admin/app/services/ajax.js index aec7a81c48..6a6a14a342 100644 --- a/ghost/admin/app/services/ajax.js +++ b/ghost/admin/app/services/ajax.js @@ -43,7 +43,7 @@ export function isVersionMismatchError(errorOrStatus, payload) { export class DataImportError extends AjaxError { constructor(payload) { - super(payload, 'he server encountered an error whilst importing data.'); + super(payload, 'The server encountered an error whilst importing data.'); } } diff --git a/ghost/admin/app/services/notifications.js b/ghost/admin/app/services/notifications.js index b0d9e31073..2393826a54 100644 --- a/ghost/admin/app/services/notifications.js +++ b/ghost/admin/app/services/notifications.js @@ -34,6 +34,8 @@ const GENERIC_ERROR_NAMES = [ 'SyntaxError', 'TypeError', 'URIError', + // ember-ajax errors - https://github.com/ember-cli/ember-ajax/blob/master/addon/errors.ts + 'AjaxError', 'ServerError' ];