chore: display generic error returned from the router (#16078)

This commit is contained in:
saledjenic 2024-08-12 19:54:42 +02:00 committed by GitHub
parent 24a386d078
commit 1231660855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -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:

View File

@ -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
}
}
}

View File

@ -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"