Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit c411f1cb erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: better error handling

Übergeordneter a4474457
No related branches found
No related tags found
2 Merge Requests!9feat: checkout billing address design improved,!8feat: checkout billing address design improved
......@@ -325,7 +325,17 @@ define('package/quiqqer/order-simple-checkout/bin/frontend/controls/SimpleChecko
});
}, {
'package': 'quiqqer/order-simple-checkout',
orderHash: this.getAttribute('orderHash')
orderHash: this.getAttribute('orderHash'),
onError: (err) => {
if (typeof err.getMessage === 'function') {
this.$showError(err.getMessage());
this.Loader.hide();
return;
}
console.error(err);
this.Loader.hide();
}
});
});
},
......@@ -370,6 +380,15 @@ define('package/quiqqer/order-simple-checkout/bin/frontend/controls/SimpleChecko
});
},
$showError: function(message) {
// @todo michael -> schönere error message
QUI.getMessageHandler().then((MH) => {
MH.addError(message);
});
console.error(message);
},
update: function() {
const PayButton = this.getElm().getElement('[name="pay"]');
......@@ -383,7 +402,19 @@ define('package/quiqqer/order-simple-checkout/bin/frontend/controls/SimpleChecko
}, {
'package': 'quiqqer/order-simple-checkout',
orderData: JSON.encode(orderData),
orderHash: this.getAttribute('orderHash')
orderHash: this.getAttribute('orderHash'),
onError: (err) => {
if (typeof err.getMessage === 'function') {
this.$showError(err.getMessage());
this.Loader.hide();
resolve();
return;
}
console.error(err);
this.Loader.hide();
resolve();
}
});
});
},
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren