From 123166085537ec72feffa1afe9d2707f3b3119e0 Mon Sep 17 00:00:00 2001 From: saledjenic <86303051+saledjenic@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:54:42 +0200 Subject: [PATCH] chore: display generic error returned from the router (#16078) --- ui/app/AppLayouts/Wallet/WalletUtils.qml | 4 ++++ ui/imports/shared/popups/send/views/NetworkSelector.qml | 2 +- ui/imports/utils/Constants.qml | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/app/AppLayouts/Wallet/WalletUtils.qml b/ui/app/AppLayouts/Wallet/WalletUtils.qml index eb379a24b8..e34d37c52d 100644 --- a/ui/app/AppLayouts/Wallet/WalletUtils.qml +++ b/ui/app/AppLayouts/Wallet/WalletUtils.qml @@ -139,6 +139,8 @@ QtObject { } switch(code) { + case Constants.routerErrorCodes.errGeneric: + return qsTr("unknown error occurred, try again later") case Constants.routerErrorCodes.processor.errFailedToParseBaseFee: case Constants.routerErrorCodes.processor.errFailedToParsePercentageFee: case Constants.routerErrorCodes.processor.errContractNotFound: @@ -221,6 +223,8 @@ QtObject { } switch(code) { + case Constants.routerErrorCodes.errGeneric: + return details case Constants.routerErrorCodes.processor.errFailedToParseBaseFee: return qsTr("failed to parse base fee") case Constants.routerErrorCodes.processor.errFailedToParsePercentageFee: diff --git a/ui/imports/shared/popups/send/views/NetworkSelector.qml b/ui/imports/shared/popups/send/views/NetworkSelector.qml index 99ffae6925..635ddfbe76 100644 --- a/ui/imports/shared/popups/send/views/NetworkSelector.qml +++ b/ui/imports/shared/popups/send/views/NetworkSelector.qml @@ -193,7 +193,7 @@ Item { width: parent.width - 2*Style.current.bigPadding text: root.routerErrorDetails font.pixelSize: Style.current.tertiaryTextFontSize - elide: Text.ElideRight + wrapMode: Text.WrapAnywhere } } } diff --git a/ui/imports/utils/Constants.qml b/ui/imports/utils/Constants.qml index 05d0c3dd20..721219f8d2 100644 --- a/ui/imports/utils/Constants.qml +++ b/ui/imports/utils/Constants.qml @@ -1072,6 +1072,9 @@ QtObject { } readonly property QtObject routerErrorCodes: QtObject { + + readonly property string errGeneric: "0" + readonly property QtObject processor: QtObject { readonly property string errFailedToParseBaseFee : "WPP-001" readonly property string errFailedToParsePercentageFee : "WPP-002"