Fix err.details check, show message if no details

The array check was wrong, resulting in no message shown and an error about empty string.
Also we should output .message if no .details, or at least a generic message if no .message too
This commit is contained in:
Alex P 2022-10-31 11:42:14 +02:00
parent 961522c8d3
commit b3df9a5b47

View file

@ -233,8 +233,12 @@ class CreditCardRenderer {
this.spinner.unblock();
this.errorHandler.clear();
if (err.details) {
if (err.details?.length) {
this.errorHandler.message(err.details.map(d => `${d.issue} ${d.description}`).join('<br/>'), true);
} else if (err.message) {
this.errorHandler.message(err.message, true);
} else {
this.errorHandler.genericError();
}
});
} else {