From 6f81e0dfde65ef92a8ea818bd0d8b22df7bdc7cd Mon Sep 17 00:00:00 2001 From: kushthedude Date: Wed, 11 Dec 2019 03:38:46 +0530 Subject: [PATCH] Displaying more informative error --- app/controllers/orders/pending.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/controllers/orders/pending.js b/app/controllers/orders/pending.js index 5ce16df1a34..bf7795f559b 100644 --- a/app/controllers/orders/pending.js +++ b/app/controllers/orders/pending.js @@ -130,10 +130,17 @@ export default Controller.extend({ }) .catch(e => { console.warn(e); - this.notify.error(this.l10n.t('An unexpected error has occurred'), - { - id: 'unexpected_error_occur' - }); + if ('errors' in e) { + this.notify.error(this.l10n.tVar(e.errors[0].detail), + { + id: 'unexpected_error_occur' + }); + } else { + this.notify.error(this.l10n.tVar(e), + { + id: 'unexpected_error_occur' + }); + } }) .finally(() => { this.set('isLoading', false);