From 93071cb2e4ddca65ffd8450963a7b40dc3e80391 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 16 Nov 2017 14:04:33 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20missing=20errors=20on=20?= =?UTF-8?q?failed=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - bug was introduced in https://github.com/TryGhost/Ghost-Admin/pull/902 where the change to `response.payload.errors` from `error.errors` was missed --- ghost/admin/app/controllers/settings/labs.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ghost/admin/app/controllers/settings/labs.js b/ghost/admin/app/controllers/settings/labs.js index a1d720325b..3f39b4e310 100644 --- a/ghost/admin/app/controllers/settings/labs.js +++ b/ghost/admin/app/controllers/settings/labs.js @@ -156,13 +156,14 @@ export default Controller.extend({ }); }).catch((response) => { if (isUnsupportedMediaTypeError(response) || isRequestEntityTooLargeError(response)) { - this.set('importErrors', [response]); - return; + return this.set('importErrors', [response]); } - if (response && response.errors && isEmberArray(response.errors)) { - this.set('importErrors', response.errors); + if (response && response.payload.errors && isEmberArray(response.payload.errors)) { + return this.set('importErrors', response.payload.errors); } + + throw response; }).finally(() => { this.set('uploadButtonText', 'Import'); });