Change in error handling.

This commit is contained in:
James Cole
2020-05-16 16:57:26 +02:00
parent 5a771ccc5f
commit 5bcafe1311

View File

@@ -449,6 +449,7 @@
}).catch(error => { }).catch(error => {
// give user errors things back. // give user errors things back.
// something something render errors. // something something render errors.
console.error('Error in transaction submission.'); console.error('Error in transaction submission.');
console.error(error); console.error(error);
this.parseErrors(error.response.data); this.parseErrors(error.response.data);
@@ -651,10 +652,10 @@
parseErrors: function (errors) { parseErrors: function (errors) {
this.setDefaultErrors(); this.setDefaultErrors();
this.error_message = ""; this.error_message = "";
if (errors.message.length > 0) { if (typeof errors.errors === 'undefined') {
this.error_message = this.$t('firefly.errors_submission'); this.error_message = errors.message;
} else { } else {
this.error_message = ''; this.error_message = this.$t('firefly.errors_submission');
} }
let transactionIndex; let transactionIndex;
let fieldName; let fieldName;