chore: display generic error returned from the router

This commit is contained in:
Sale Djenic 2024-08-06 15:07:27 +02:00 committed by saledjenic
parent 790d34d875
commit b8ffa65113
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

@ -212,7 +212,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

@ -1059,6 +1059,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"