Skip to main content

Error Handling

While using the UniPass SDK, errors may be thrown. In order to handle errors more gracefully, the relevant errors are defined as follows:

public enum UniPassError: Error {
case noBundleIdentifierFound
case userNotLogin
case userCancelled(msg: String?)
case appCancelled
case invalidFromAddress
case invalidTransaction
case unknownError
case runtimeError(msg: String)
case decodingError
case encodingError
}
ErrorParameterDescription
noBundleIdentifierFoundApp bundle id not found
userNotLoginCall signMessage or sendTransaction when user not login
userCancelledmsgUser click cancel button Login / SignMessage / SendTransaction in UniPass pages
appCancelledUser close webview or reject webview open request
invalidFromAddressSignMessage / SendTransaction with invalid from address
invalidTransactionSendTransaction with invalid parameters
unknownErrorunknown errors
runtimeErrormsgruntime error occured in UniPass Wallet
encodingErrorencode request parameters errors
decodingErrordeocode response errors