🐛 Fixed missing error message for unexpected errors during import (#936)

no issue
- show an error message when a non-Ghost error is received, eg. when a proxy server times out due to a large import
This commit is contained in:
Kevin Ansfield 2018-01-03 12:30:42 +00:00 committed by GitHub
parent e7be0075d8
commit 191300de74

View File

@ -171,11 +171,11 @@ export default Controller.extend({
});
}).catch((response) => {
if (isUnsupportedMediaTypeError(response) || isRequestEntityTooLargeError(response)) {
return this.set('importErrors', [response]);
}
if (response && response.payload.errors && isEmberArray(response.payload.errors)) {
return this.set('importErrors', response.payload.errors);
this.set('importErrors', [response]);
} else if (response && response.payload.errors && isEmberArray(response.payload.errors)) {
this.set('importErrors', response.payload.errors);
} else {
this.set('importErrors', [{message: 'Import failed due to an unknown error. Check the Web Inspector console and network tabs for errors.'}]);
}
throw response;