feat(dapps) fail on Wallet Connect unsupported networks
Also extend the generic error handling of approval errors Updates: #14676
This commit is contained in:
parent
498d4c969c
commit
1e256c8bf1
|
@ -131,7 +131,12 @@ QObject {
|
|||
|
||||
function onBuildApprovedNamespacesResult(approvedNamespaces, error) {
|
||||
if(error) {
|
||||
// TODO: error reporting
|
||||
// Check that it contains Non conforming namespaces"
|
||||
if (error.includes("Non conforming namespaces")) {
|
||||
root.pairingUriValidated(Pairing.uriErrors.unsupportedNetwork)
|
||||
} else {
|
||||
root.pairingUriValidated(Pairing.uriErrors.unknownError)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -10,5 +10,7 @@ QtObject {
|
|||
readonly property int invalidUri: 3
|
||||
readonly property int alreadyUsed: 4
|
||||
readonly property int expired: 5
|
||||
readonly property int unsupportedNetwork: 6
|
||||
readonly property int unknownError: 7
|
||||
}
|
||||
}
|
|
@ -48,6 +48,12 @@ ColumnLayout {
|
|||
}
|
||||
if (errorText.text.length > 0) {
|
||||
return false
|
||||
} else if(root.errorState === Pairing.uriErrors.unsupportedNetwork) {
|
||||
errorText.text = qsTr("dApp is requesting to connect on an unsupported network")
|
||||
return false
|
||||
} else if(root.errorState === Pairing.uriErrors.unknownError) {
|
||||
errorText.text = qsTr("Unexpected error occurred, please try again")
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue