From 93d95388457a25426e4aa68e0d637b528b74ff73 Mon Sep 17 00:00:00 2001 From: natsoni Date: Sat, 12 Oct 2024 15:56:38 +0900 Subject: [PATCH] Fix error formatting on core only backend --- .../components/push-transaction/push-transaction.component.ts | 2 +- .../components/test-transactions/test-transactions.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/push-transaction/push-transaction.component.ts b/frontend/src/app/components/push-transaction/push-transaction.component.ts index 03a050dfa..d56ffa2d1 100644 --- a/frontend/src/app/components/push-transaction/push-transaction.component.ts +++ b/frontend/src/app/components/push-transaction/push-transaction.component.ts @@ -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; diff --git a/frontend/src/app/components/test-transactions/test-transactions.component.ts b/frontend/src/app/components/test-transactions/test-transactions.component.ts index c9abeed62..615f635cd 100644 --- a/frontend/src/app/components/test-transactions/test-transactions.component.ts +++ b/frontend/src/app/components/test-transactions/test-transactions.component.ts @@ -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;