Fix error formatting on core only backend

This commit is contained in:
natsoni 2024-10-12 15:56:38 +09:00
parent ae46fcafb9
commit 93d9538845
No known key found for this signature in database
GPG Key ID: C65917583181743B
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ export class PushTransactionComponent implements OnInit {
},
(error) => {
if (typeof error.error === 'string') {
const matchText = error.error.match('"message":"(.*?)"');
const matchText = error.error.replace(/\\/g, '').match('"message":"(.*?)"');
this.error = 'Failed to broadcast transaction, reason: ' + (matchText && matchText[1] || error.error);
} else if (error.message) {
this.error = 'Failed to broadcast transaction, reason: ' + error.message;

View File

@ -74,7 +74,7 @@ export class TestTransactionsComponent implements OnInit {
},
(error) => {
if (typeof error.error === 'string') {
const matchText = error.error.match('"message":"(.*?)"');
const matchText = error.error.replace(/\\/g, '').match('"message":"(.*?)"');
this.error = matchText && matchText[1] || error.error;
} else if (error.message) {
this.error = error.message;