diff --git a/src/javascripts/ng-admin/Crud/delete/DeleteController.js b/src/javascripts/ng-admin/Crud/delete/DeleteController.js index 712dcf31..107c3156 100644 --- a/src/javascripts/ng-admin/Crud/delete/DeleteController.js +++ b/src/javascripts/ng-admin/Crud/delete/DeleteController.js @@ -43,11 +43,16 @@ export default class DeleteController { $translate('DELETE_SUCCESS').then(text => notification.log(text, { addnCls: 'humane-flatty-success' })); }) .catch(error => { - const errorMessage = this.config.getErrorMessageFor(this.view, error) | 'ERROR_MESSAGE'; + const errorMessage = this.config.getErrorMessageFor(this.view, error) || 'ERROR_MESSAGE'; $translate(errorMessage, { status: error && error.status, details: error && error.data && typeof error.data === 'object' ? JSON.stringify(error.data) : {} - }).then(text => notification.log(text, { addnCls: 'humane-flatty-error' })); + }) + .then(text => notification.log(text, { addnCls: 'humane-flatty-error' })) + .catch(err => { + console.warn('Unable to translate error message. Displaying key instead.', err); + notification.log(errorMessage, { addnCls: 'humane-flatty-error' }); + }); }); }